我使用以下代码在控制器中执行操作:
[Authorize(Roles = "members")]
[HttpPost]
public ActionResult login(string uname,string pass)
{
MembersSrv mm = new MembersSrv();
if (mm.validateUsers(uname,pass)==true)
{
mm.CreateCookie(uname, pass);
return RedirectToAction("Index");
}
else
return RedirectToAction("Login");
}
我怎样才能得到这个网址?
http://localhost:5555/Members/Login
这条路线是真的吗?
routes.MapRoute(
"Login", // Route name
"Members/{action}/{Uname}", // URL with parameters
new { action = "Login", Uname =" " } // Parameter defaults
);