I am using websites and I needed a way to access the BundleConfig, IdentityConfig, and RouteConfig classes and modules from with in my Global.asax file. I was able to put these files into the "App_Code" folder which allows you to put namespaces around the classes and modules.
Here is an example:
Namespace TCEmpSite
Public Module RouteConfig
Sub RegisterRoutes(ByVal routes As RouteCollection)
Dim settings As FriendlyUrlSettings = New FriendlyUrlSettings()
settings.AutoRedirectMode = RedirectMode.Permanent
routes.EnableFriendlyUrls(settings)
End Sub
End Module
End Namespace
Then in the Global.asax file I was able to do this:
Private Sub Application_Start(sender As Object, e As EventArgs)
' Code that runs on application startup
TCEmpSite.RouteConfig.RegisterRoutes(RouteTable.Routes)
TCEmpSite.BundleConfig.RegisterBundles(BundleTable.Bundles)
TCEmpSite.IdentityConfig.ConfigureIdentity()
End Sub
Hope this helps someone!