开发者

Why my URL routing does not work?

In application start of the global.asax i have

 Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    开发者_Python百科    RegisterRoutes(RouteTable.Routes)
 End Sub

and

Private Sub RegisterRoutes(ByVal routes As RouteCollection)
  routes.MapPageRoute("contactform", "{locale}/contact", "~/general/ContactUs.aspx")
End Sub

the strange that is goimg on, is that when i visit the webpage directly

~/general/contactus.aspx

everything works like a charm, but when i visit the page indirectly

~/en/contact

a 404 error is returned! Am i missing something here?


This can be related to multiple things. What I would first look at is that :

Make sure that your application is running under IIS 7.0 or +.

Make sure that your application is running under an integrated mode app pool inside IIS 7 or IIS 7.5.

Make sure that you have the following code inside your web.config file :

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
</system.webServer> 

Not sure though but the above code shouldn't be necessary on IIS 7.5. This should be already configured for IIS 7.5 out of the box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜