http://runtingsproper.blogspot.co.uk/2012/07/a-straightforward-method-to-detecting.html
Monday, August 13, 2012
Thursday, August 9, 2012
How to add http header into ASP.NET development server, Cassini, to change document mode in IE?
Add following line in Global.asax
protected void Application_BeginRequest() {
HttpContext.Current.Response.AddHeader("X-UA-Compatible", "IE=edge");
}
protected void Application_BeginRequest() {
HttpContext.Current.Response.AddHeader("X-UA-Compatible", "IE=edge");
}
Wednesday, August 8, 2012
Tuesday, August 7, 2012
Handling Exceptions and 404 Errors in ASP.NET MVC
1. Add Customer error section in web.config file
2. Log exception in Application_Error event handler
2. Log exception in Application_Error event handler
void Application_Error(object sender, EventArgs e)
{
try
{
//Get the Error.
Exception ex = Server.GetLastError();
Response.Redirect("~/YourErrorPage");
}
catch
{
//Response.Redirect("/oops.aspx");
}
}
Subscribe to:
Posts (Atom)