Archive: April 17, 2006
-
Coding Horror: XP Automatic Update Nagging. I set "Re-prompt for restart with scheduled installations" to 720 minutes (12 hours).
¶ (0)
Tags: [Windows]
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]
|
Generated in about 0.052s. (Used 7 db queries) |
I hate ASP.NET
I hate ASP... I was doing wonderswith PHP, then suddenly one of myclients...
Johnies: Mar 17, 6:14am