Author: drewf | Posted on: 5/7/2010 2:57:34 PM | Views : 1215

I've been using different routes.MapPageRoute registrations that were dependent on the domain (I have multiple pointing to the same web application). I was accomplishing this by determining the domain (or sub-domain) using Context.Request.Url.Host within RegisterRoutest. Of course, this all is kicked off at Application_Start, which worked in IIS6, but now I've moved to IIS7, and Request doesn't seem to be available at Application_Start anymore. Can anyone suggest a way to get the domain at Application_Start, or is this simply not possible with IIS7?


Here's an example of the code I've been using in my Global.asax:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) RegisterRoutes(RouteTable.Routes) End Sub Sub RegisterRoutes(ByVal routes As Routing.RouteCollection) Dim strHost As String = Context.Request.Url.Host Dim strDir As String = "" ...

Go to the complete details ...