[英]Redirecting Login in button
As I login (enter -- email and enter-- password) I would like to click on the login button to redirect to anther MVC asp.net page. 当我登录(输入 - 电子邮件并输入 - 密码)时,我想点击登录按钮重定向到另一个MVC asp.net页面。
How would I do that? 我该怎么办?
You need handle in action post using Redirect(redirectpage)
like this 你需要使用像这样的Redirect(redirectpage)
来处理动作
public ActionResult Login(LoginModel model)
{
// handle logic here
string redirectpage = "/home";
return Redirect(redirectpage);
}
You can follow this link for creating Login page https://docs.microsoft.com/en-us/aspnet/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation-and-password-reset 您可以点击此链接创建登录页面https://docs.microsoft.com/en-us/aspnet/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation -和-密码重置
try this code for redirecting to another page 尝试使用此代码重定向到另一个页面
Public ActionResult Login(ModelName Objects)
{
//your code;
return RedirectToAction("ActionName", "ControllerName");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.