Routing for custom ASP.NET MVC 404 Error page

I’ve tried to enable custom errors on production server for 3 hours, seems I found final solution how to do this in ASP.NET MVC without any routes. To enable custom errors in ASP.NET MVC application we need (IIS 7+): Configure custom pages in web config under system.web section: <customErrors mode=”RemoteOnly” defaultRedirect=”~/error”> <error statusCode=”404″ redirect=”~/error/Error404″ /> … Read more

ASP.NET MVC ambiguous action methods

MVC doesn’t support method overloading based solely on signature, so this will fail: public ActionResult MyMethod(int someInt) { /* … */ } public ActionResult MyMethod(string someString) { /* … */ } However, it does support method overloading based on attribute: [RequireRequestValue(“someInt”)] public ActionResult MyMethod(int someInt) { /* … */ } [RequireRequestValue(“someString”)] public ActionResult MyMethod(string someString) … Read more

Is it possible to make an ASP.NET MVC route based on a subdomain?

You can do it by creating a new route and adding it to the routes collection in RegisterRoutes in your global.asax. Below is a very simple example of a custom Route: public class ExampleRoute : RouteBase { public override RouteData GetRouteData(HttpContextBase httpContext) { var url = httpContext.Request.Headers[“HOST”]; var index = url.IndexOf(“.”); if (index < 0) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)