我正在为用户注册、显示、登录等创建一个网站。我目前正在尝试显示已登录用户的详细信息。但是在登录的 actionResult 中,我不知道如何调用显示的 actionResult?我是 asp.net 的新手。我需要建议
public ActionResult login()
{
try
{
return View();
}
catch (Exception ex)
{
throw ex;
}
}
[HttpPost]
public ActionResult login(DEntities.Users user)
{
try
{
services.CheckUser(user);
controlsuccess = services.servicesuccess;
if (controlsuccess == true)
{
return RedirectToAction("display");
//return View("display");
}
else
{
return HttpNotFound();
}
}
catch (Exception ex)
{
throw ex;
}
}
public ActionResult display()
{
return View();
}
[HttpPost]
public ActionResult display(int id = 0)
{
try
{
DEntities.Users user = services.GetUserbyId(id);
return View(user);
}
catch (Exception ex)
{
throw ex;
}
}