2016-04-29 51 views
0

如何ASP.NET路由可以不使用MVC路由在本地asp.net(不Asp.NET MVC)

作爲一個例子來實現,這是我 本地主機 http://localhost/

和我有user.aspx

http://localhost/user.aspx

我怎麼可以得到如下的URL路由到不同的功能在這user.aspx page?

http://localhost/user/example1

http://localhost/user/example1/setting

http://localhost/user/example1/setting/changeImage

http://localhost/user/example1/setting/enableView

http://localhost/user/example1/security

http://localhost/user/example/message/view

http://localhost/user/example/message/send

的重要問題,當用戶請求該路徑 http://localhost/user/example/message/viewhttp://localhost/user/example/message/send 我怎麼可以顯示的形式來看,或發送

+0

這是一個mvc應用程序嗎?你標記了asp.net-mvc – Shyju

回答

0

很長一段時間後,我嘗試過同樣使用RouteTable和IIS的URLRewriterExtension。我寫了一篇關於它的博客文章here

您需要一張路由表來註冊路由。自定義路由處理程序,它將根據URL上的值返回實際頁面。

您還可以從MSDN Code下載工作示例。