Speed Up The Web Part III
Boy oh boy, it's about time we go another one of these "Speed Up The Web" articles out here. As with our last article we showed you how you can develop your ASP.Net website and automatically concatenate your scripts and stylesheets. This article will show you a nice and easy…IIS WarmUp Part II
I explained in my earlier post the importance of "warming up" your sites in IIS, especially using the latest .Net frameworks. Here is a major update to the code posted in that post. This one will allow you to "warm up" every site in IIS on your server. All you…IIS Site Warmup
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice to be able to simply…URL Rewriting without 3rd Party Add-Ons
.Net 3.5 Brought to developers of MVC applications the wonderful world of Page Routing. This allows us .Net developers to not have to worry about SEO friendly URLs (pretty much) any more, as we can simplify the URL rewritting process and get rid of those pesky 3rd party add-ons. .Net…- 1
- 2
Cookie Notice
This site utilizes cookies to improve your browsing experience, analyze the type of traffic we receive, and serve up proper content for you. If you wish to continue browsing, you must agree to allow us to set these cookies. If not, please visit another website.
URL Rewriting without 3rd Party Add-Ons
.Net 3.5 Brought to developers of MVC applications the wonderful world of Page Routing. This allows us .Net developers to not have to worry about SEO friendly URLs (pretty much) any more, as we can simplify the URL rewritting process and get rid of those pesky 3rd party add-ons.
.Net 4 brings this Page Routing to web forms. Which allows the same thing, however, now we do not have to be developing an MVC application in order for it to be utilized.
Yes, there is a little extra code that is necessary to make this all work, however it is well worth the 4-5 lines, of code you can control, over the 3rd party reference with which you have no control over the source code.
You will need to edit your Global.asax file, as well as any other .aspx page that will utilize the routing.
In the case of o7th Web Design’s Site Rendering Engine, here is the code snippet that they use to route all page requests to the only page in the application: /Default.aspx
Global.asax
Imports System.Web.Routing Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) RegisterRoutes(RouteTable.Routes) End Sub Private Sub RegisterRoutes(ByVal Routes As RouteCollection) With Routes 'Do not Route Existing Files .RouteExistingFiles = False 'Ignore These .Ignore("images/{*pathInfo}") .Ignore("scripts/{*pathInfo}") .Ignore("styles/{*pathInfo}") 'Re-Route These .MapPageRoute("Ajax-Default-Nav", "Ajax/{APage}/", "~/Default.aspx") .MapPageRoute("Mobile-Default-Nav", "Mobile/{MPage}/", "~/Default.aspx") .MapPageRoute("Non-Mobile", "{Page}/", "~/Default.aspx") End With End Sub
And to process these requests:
Default.aspx
Private _PageLink = Page.RouteData.Values("Page") Private _APageLink = Page.RouteData.Values("APage") Private _MPageLink = Page.RouteData.Values("MPage")
More info: http://msdn.microsoft.com/en-us/library/cc668201.aspx