asp.net mvc keep object alive, information

前端 未结 4 367
梦如初夏
梦如初夏 2020-11-30 13:17

i have this code

[HttpPost]
public ActionResult Index(LoginModel loginModel)
{
    if (ModelState.IsValid)
    { 
       // some lines of code . bla bla bla
         


        
4条回答
  •  不知归路
    2020-11-30 13:59

    I suggest you create a new MVC 3 project in Visual Studio via File > New. It will set up forms authentication for you, so you can see the best practices for the login and registration pages, signing the user in/out with the session cookie, and displaying user info like username.

提交回复
热议问题