Tag: .NETParents:
Children:
-
ASP.NET UI and Charting Controls by ComponentArt.
¶ (0)
Tags: [ASP.NET]
-
Easily refresh an UpdatePanel, using JavaScript | Encosia.
¶ (0)
Tags: [ASP.NET]
-
Why ASP.NET AJAX UpdatePanels are dangerous | Encosia. PageMethods, neato. No reason to use Prototype, etc. with ASP.NET.
¶ (0)
Tags: [ASP.NET]
-
obout inc appears to have some high-quality ASP.NET controls.
¶
Tags: [ASP.NET]
-
Binary Fortress Software | ASP.NET ViewState Helper (via).
¶ (0)
Tags: [ASP.NET]
-
TreeView control stuff:
¶ (0)
Tags: [ASP.NET]
The more I use ASP.NET, the more I can't stand it. I'm using the ASP.NET Ajax stuff and it'd be so much faster if I just did everything "manually" rather than navigating this maze of UpdatePanels and RegisterClientScriptBlocks and AsyncPostBackTriggers.
Web apps are just XmlHttpRequest + some JSON and CSS and DOM manipulation. I already know all that stuff. Why does Microsoft fail so hard at simplification that they make it more complex?
-
Jayrock: JSON and JSON-RPC for .NET.
¶ (0)
Tags: [ASP.NET, Json]
-
15 Seconds : Tuning Up ADO.NET Connection Pooling in ASP.NET Applications.
¶ (0)
Tags: [ASP.NET]
-
ASP.NET AJAX Control Toolkit.
¶
Tags: [ASP.NET, Javascript]
-
John Lam on Software: A first look at IronRuby. To read.
¶ (0)
Tags: [IronRuby]
-
How To Copy DataRows Between DataTables by Using Visual C# .NET:
Before you use the ImportRow method, you must ensure that the target table has the identical structure as the source table. This sample uses the Clone method of DataTable class to copy the structure of the DataTable, including all DataTable schemas, relations, and constraints.
¶ (0)
Tags: [.NET]
-
Ruby/.NET Bridge.
¶ (0)
Tags: [.NET, Ruby]
-
IronPython. The official home page of IronPython. Google is out of date.
¶ (0)
Tags: [IronPython]
Json.NET - Newtonsoft, a C# implementation of JSON. Looks really good from their example... about to try it out.
Update: based on testing so far, it works great. Their example output is incorrect however. It uses single quotes, when only double quotes are allowed in JSON. But the code in fact does the right thing.
Note that the library will generate invalid JSON and include language-specific types in it, such as a date. And that's actually desirable, since if you're just using it as serialization for your own code you get what you want, and can be careful and not use language-specific types if you need to share with others.
-
String.IsNullOrEmpty can lead to runtime Null exceptions (via Adam). Nice.
¶ (0)
Tags: [.NET]
-
Geekpedia • ASP.NET: The name 'Session' does not exist in the current context. I think this'll happen in particular if you're trying to access Session from a class defined in App_Code. Use HttpContext.Current.Session instead.
¶
Tags: [ASP.NET]
-
PageMethods, well-defined URLs for your ASP.NET sites by metaSapiens. Looks pretty neat. It seems to work something like the URI to object method call frameworks that exist for other languages.
¶ (0)
Tags: [ASP.NET]
-
MonoRail:
MonoRail (former Castle on Rails) is a MVC web framework inspired on Action Pack. The Action Pack way of development is extremely productive, very intuitive and easily testable.
MonoRail differs from the standard WebForms way of development as it enforces separation of concerns; controllers just handle application flow, models represent the data, and the view is just concerned about presentation logic. Consequently, you write less code and end up with a more maintainable application.
¶ (0)
Tags: [ASP.NET, Ruby on Rails]
-
Cassini Web Server - Free Redistributable ASP.NET Web Server from UltiDev LLC.
¶ (0)
Tags: [ASP.NET]
It's actually very simple to do clean URIs in an ASP.NET application. In your Global.asax file:
string root = "/rootofyourapp";
void Application_Start(object sender, EventArgs e){
Dictionary<string,string> mapping = new Dictionary<string,string>();
mapping[root+"/page"]=root+"/page.aspx";
Application.Add("mapping",mapping);
}
void Application_BeginRequest(object sender, EventArgs e){
HttpContext context = HttpContext.Current;
string path = context.Request.Path;
Dictionary<string,string> mapping =
(Dictionary<string,string>)Application["mapping"];
if(mapping.ContainsKey(path)){
context.RewritePath(mapping[path]);
}else{
Response.AddHeader("Content-type","text/plain;charset=UTF-8");
Response.Write("Invalid request: "+path+"\n\n");
Response.End();
}
}
And to forward all requests through to a single URI:
void Application_BeginRequest(object sender, EventArgs e){
HttpContext.Current.RewritePath("~/Default.aspx");
}
-
MySpace does 1.5 billion page views per day using ASP.NET 2.0. They just switched from ColdFusion, a Java based technology, and their server load went down dramatically. Of course it's not surprising that switching from Java would make your app run faster, but what makes this so ironic is that they're still largely using ColdFusion, but using a .NET-based reimplementation called BlueDragon. So, a .NET-based reimplementation of ColdFusion runs dramatically faster than the original Java-based implementation.
¶
Tags: [.NET, ColdFusion, Java]
-
ViewState Decoder (2.1) by Fritz Onion. Also see this article by Paul Wilson (who apparently used to have a similar tool online that's no longer available) about ASP.NET's viewstate process (to read).
¶ (0)
Tags: [ASP.NET]
Does anyone know of a way to pretty-print .NET objects? We've covered before how .NET objects don't stringify into anything good, so I'm looking for a pretty-printer to aid in debugging. .NET has such good reflection that I'm surprised I can't find a pre-existing library or built-in .NET facility. Do I have to take a half hour and write my own pretty-printer?
Update (2:29pm): There we go, this only took me about 20 minutes:
using System;
using System.Text;
using System.Reflection;
class foobar{
string foo, bar, baz;
bar b = new bar();
}
class bar{
string roar, blah;
}
namespace PrettyPrinter{
public class PrettyPrinter{
public static void Main(string[] args){
foobar f = new foobar();
Console.WriteLine(pp(f));
int i = 2;
Console.WriteLine(pp(i));
}
public static string pp(object o){
StringBuilder sb = new StringBuilder();
pp(sb, o, 0);
return sb.ToString();
}
public static void pp(StringBuilder sb, object o, int level){
Type t = o.GetType();
FieldInfo[] members = t.GetFields(
BindingFlags.Public
| BindingFlags.NonPublic
| BindingFlags.Instance
);
foreach(FieldInfo info in members){
object val = info.GetValue(o);
sb.Append('\t',level);
sb.Append(info.ToString()).Append(": ");
if(val == null){
sb.AppendLine("null");
}else if(info.FieldType.IsClass){
sb.AppendLine("{");
pp(sb, val, level+1);
sb.Append('\t',level).AppendLine("}");
}else{
sb.AppendLine(o.ToString());
}
}
}
}
}
Output:
C:\DEV\Projects\test\bin\Debug>test
System.String foo: null
System.String bar: null
System.String baz: null
bar b: {
System.String roar: null
System.String blah: null
}
Int32 m_value: 2
Update (4:57pm): Since of course that was a first pass, here's a more correct version that handles circular references, and for Keith also dumps XML if you happen to pass it an XmlNode 
using System;
using System.Xml;
using System.Text;
using System.Reflection;
using System.Collections.Generic;
using pp = PrettyPrinter.PrettyPrinter;
namespace PrettyPrinter{
public class PrettyPrinter{
private static Type str = typeof(string);
private static Type xml = typeof(XmlNode);
public static string pp(object o){
if(o == null)
return "null";
StringBuilder sb = new StringBuilder();
sb.Append(o.GetType()).Append(": ");
pp(new Dictionary<object, bool>(), sb, o, 0);
return sb.ToString();
}
public static void pp(
Dictionary<object, bool> seen_objects,
StringBuilder sb, object o, int level
){
Type t = o.GetType();
if(t == str || t.IsValueType){
sb.AppendLine(o.ToString());
}else if(xml.IsInstanceOfType(o)){
sb.AppendLine(((XmlNode)o).OuterXml);
}else if(t.IsClass){
if(seen_objects.ContainsKey(o)){
sb.AppendLine("RECURSION!");
return;
}
seen_objects.Add(o, true);
FieldInfo[] fields = t.GetFields(
BindingFlags.Public
| BindingFlags.NonPublic
| BindingFlags.Instance
);
sb.AppendLine("{");
foreach(FieldInfo info in fields){
object val = info.GetValue(o);
sb.Append('\t',level+1).Append(info).Append(": ");
if(val == null){
sb.AppendLine("null");
}else{
pp(seen_objects, sb, val, level+1);
}
}
sb.Append('\t',level).AppendLine("}");
}
}
}
}
class foobar{
string foo, bar, baz = "roar";
public testing.bar b = new testing.bar();
}
namespace testing{
class bar{
string roar, blah;
public foobar f;
}
class baz{
public baz b = null;
}
}
public class Test{
public static void Main(string[] args){
foobar f = new foobar();
f.b.f = f;
Console.WriteLine(pp.pp(f));
int i = 2;
Console.WriteLine(pp.pp(i));
XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<?xml version=""1.0""?>
<foo><bar><baz>roar</baz></bar></foo>"
);
Console.WriteLine(pp.pp(doc.ChildNodes[1]));
testing.baz b = new testing.baz();
b.b = b;
Console.WriteLine(pp.pp(b));
}
}
Output:
C:\DEV\Projects\test\bin\Debug>test
foobar: {
System.String foo: null
System.String bar: null
System.String baz: roar
testing.bar b: {
System.String roar: null
System.String blah: null
foobar f: RECURSION!
}
}
System.Int32: 2
System.Xml.XmlElement: <foo><bar><baz>roar</baz></bar></foo>
testing.baz: {
testing.baz b: RECURSION!
}
(code reformatted to not break my layout)
-
Mike Stall's .NET Debugging Blog : How to embed IronPython script support in your existing app in 10 easy steps. I don't agree with everything he did here, but it's a darn useful reference and introduction, and he has some neat tricks.
¶ (0)
Tags: [IronPython]
The .NET standard library is good, but it feels like it has lots of "holes" in it, even in 2.0. For instance, why is the Converter delegate used separately on Array's and List's ConvertAll rather than being defined on a Collection or an Enumerable so that I could use ConvertAll on things like Dictionary.KeyCollection? The answer, of course, is that Collection and Enumerable are actually ICollection and IEnumerable and are not classes.
So, Microsoft didn't choose to duplicate ConvertAll everywhere it'd be useful, just in a couple of places. What this means as well is that even though you can use a foreach loop on something, you can't necessarily do a ConvertAll on it (or use the other higher-order methods). In contrast, look at Ruby, where as long as you have an each method (IIRC), you get everything associated with it for free.
Also see Adam's description of GetValue and SetValue on properties and accessors, another case where Microsoft has the same method names for similar functionality on multiple classes but no common interface or base class between them, so they can't be used interchangeably. (Insert comment about the utility of duck-typing here...)
As an aside, I also feel like it's just darn hard to find things reliably in Microsoft's documentation.
-
ASP.NET 2.0 Training Center: Cross Training for Web Developers:
This section of the ASP.NET 2.0 Training Center helps the PHP developer learn more about PHP, and also add to their skillset by mastering ASP.NET 2.0. In the coming weeks, you'll learn how to get up to speed with ASP.NET 2.0, and you'll find details about interoperability between PHP and ASP.NET 2.0.
To help you, you'll also find a series of webcasts specifically created, from the ground up, by world-class experts and presenters to teach ASP.NET to PHP developers.
Started reading the first article on the page and it's excellent so far.
¶ (0)
Tags: [ASP.NET, PHP]
If you're not sure whether to use a TableAdapter or a DataAdapter, this tells you which one you should use:
The typical Visual Studio mechanism for executing Transact-SQL queries and for filling datasets is the TableAdapter.
You can execute SQL statements or stored procedures against a data source using TableAdapters or command objects (for example, SqlCommand). To load data into datasets created using design tools in Visual Studio, use TableAdapters. To load data into datasets created programmatically, use data adapters. If your application does not use datasets, use command objects to execute SQL statements or stored procedures directly against a database.
If you create a dataset with a Visual Studio design-time tool (such as the Dataset Designer or the Data Source Configuration Wizard), then you use a TableAdapter to fill it. TableAdapters execute your SQL statements or stored procedures.
If you create a dataset without design-time tools, then you must use data adapters to fill and update data. (TableAdapters are not actual classes in the .NET Framework, so they are not suitable for working with datasets that have been created without the use of design-time tools. For more information on loading data into datasets with either TableAdapters or data adapters, see How to: Fill a Dataset with Data.
-
Brad Abrams: The change from Hashtable to Dictionary.
¶ (0)
Tags: [.NET, C#]
|
Generated in about 0.173s. (Used 11 db queries) |
new⇒Spider solitaire
I to am somewhat addicted tospending too much time on SS. Ihave been stu...
stupid_horse: Mar 20, 10:34pm