Allow Dots in URL (IIS)

IIS, by default, blocks access to any file types it doesn’t recognise. If a dot (.) is in the URL, IIS assumes its a file name and blocks access. To allow dots in a URL on an IIS site (perhaps for domain names/email addresses/etc. in a MVC routing path) you have to make a couple … More Allow Dots in URL (IIS)

Breaking String URL into Route Data ASP.NET MVC

Getting your route data into URL format is easy – simply use the UrlHelper (Url.Action). But reversing this, and parsing a URL is a bit more fiddly: string path = “”; string queryString = “”; System.Web.Routing.RouteData routeFromUrl = System.Web.Routing.RouteTable.Routes.GetRouteData(new HttpContextWrapper(new HttpContext(new HttpRequest(null, new UriBuilder(Request.Url.Scheme, Request.Url.Host, Request.Url.Port, path).ToString(), queryString), new HttpResponse(new System.IO.StringWriter())))); You can then use … More Breaking String URL into Route Data ASP.NET MVC