2009-05-31 123 views

回答

8

其實,你要的是這樣的:

routes.MapRoute(
      "RegisterRoute", 
      "Register", 
      new { controller = "Registration", action = "Register" } 
     ); 

現在你可以去你的頁面,就像一個網址:

http://www.yoursite.com/register

+0

你說得對。它只需要在URL定義中有「註冊」。謝謝! – Alex 2009-05-31 20:23:06

0
routes.MapRoute(
       "MyCustomRoute",            // Route name 
       "Registration/Register",       // URL with parameters 
       new { controller = "Registration", action = "Register" } // Parameter defaults 
      ); 
+0

這將使用URL http才起作用://www.yoursite.com/Registration/Register。我相信亞歷克斯想要像http://www.yoursite.com/Register。 – 2009-05-31 19:55:05