我正在使用ASP.NET MVC 3並遵循教程http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-cs。ASP.NET MVC 3基本路由問題
我正在註冊功能並嘗試使用路由。所以典型的情況是:
- 當用戶想要註冊時,他會被帶到/帳戶/註冊。
- 成功註冊後,他將被重定向到/ Account/SignUp/Successful。
我認爲這會很簡單,但「成功」參數永遠不會在控制器的SignUp方法中傳遞。
public ActionResult SignUp(string msg)
{
// Do some checks on whether msg is empty or not and then redirect to appropriate view
}
在global.aspx.cs我已經得到了相當多的香草路由:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
什麼我不能在這裏抓?
嘿安德魯,是不是第二個方法所需的一切? – DavidS 2011-03-18 07:11:48
是的,我認爲我錯誤地閱讀了你的問題 – 2011-03-18 08:23:29