October 26th, 2010
After a few months of discussions and ideas being passed around we are now finally in the final stage of our re-brand.
Didsbury Design is the new name for Zero7Web. We will be offering the same high quality services as before, with extra services being added.
Website Hosting Upgrade
We have invested in a new, faster, even more reliable web hosting provider which means our clients websites will load even quicker than before! We can pass on our providers 100% network uptime guarantee and we are also proud to announce our web hosting is the first in the UK to be carbon neutral.
The hosting upgrade will not affect prices for current clients, although we will start to bill for domain names separately from now on which still keeps our prices very competitive.
Windows .NET 4 / MVC2 Support
We can now support additional languages for web development including Microsoft SQL, Classic ASP and the .NET framework including version 4.0.
We hope you like the new website and we very much look forward to working with you in the future.
Didsbury Design Team
February 6th, 2010
If you wan’t to allow hyphens in your URL’s you will need to change the way the routing works in your Global.asax file.
First create a new class which extends the MvcRouteHandler and place this in the Global.asax file after the main MvcApplication class.
C#:
public class HyphenatedRouteHandler : MvcRouteHandler{
protected override IHttpHandler GetHttpHandler(RequestContext requestContext)
{
requestContext.RouteData.Values["controller"] = requestContext.RouteData.Values["controller"].ToString().Replace("-", "_");
requestContext.RouteData.Values["action"] = requestContext.RouteData.Values["action"].ToString().Replace("-", "_");
return base.GetHttpHandler(requestContext);
}
}
VB:
Public Class HyphenatedRouteHandler
Inherits MvcRouteHandler
Protected Overrides Function GetHttpHandler(ByVal requestContext As System.Web.Routing.RequestContext) As System.Web.IHttpHandler
requestContext.RouteData.Values("controller") = requestContext.RouteData.Values("controller").ToString.Replace("-", "_")
requestContext.RouteData.Values("action") = requestContext.RouteData.Values("action").ToString.Replace("-", "_")
Return MyBase.GetHttpHandler(requestContext)
End Function
End Class
Then you need to replace the routes.MapRoute with an equivalent routes.Add specifying the new handler as the MapRoute does not allow you to specify a custom route handler.
C#:
routes.Add(
new Route("{controller}/{action}/{id}",
new RouteValueDictionary(
new { controller = "Default", action = "Index", id = "" }),
new HyphenatedRouteHandler())
);
VB:
routes.Add(New Route("{controller}/{action}/{id}",
New RouteValueDictionary(New With {.controller = "Home", .action = "Index", .id = ""}),
New HyphenatedRouteHandler()))
I hope this is useful, any questions feel free to get in touch.
Would like to say thanks to John from here for answering the original question on Stackoverflow