如何在Asp.Net MVC3中创建登录名 [英] how to create a Login in Asp.Net MVC3

查看:85
本文介绍了如何在Asp.Net MVC3中创建登录名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我必须在Asp.Net MVC中创建一个登录页面.我也想在其中使用cookie概念,即(保存cookie).
登录将基于三个参数,例如(RegistrationNo,出生日期,密码).我的登录选项位于主页本身.比较参数并成功登录后导航至所需视图.
我在Index方法的[HttpPost]操作中执行此操作.在用户填写登录详细信息(RegistrationNo,出生日期,密码)后,单击Login,将比较数据库中的值,并在成功登录后将导航转到特定页面.我成功完成了此操作.
我的问题是我也想保存cookie.
任何人都可以为我提供一些示例/演练/短视频教程来完成此任务.
请对此进行指导/帮助.


I have to create a login page in Asp.Net MVC.I want use the cookies concept into it as well ie(save cookies).
The login will be based on three parameters say(RegistrationNo,Date of Birth,Password).My login options are on the home page itself.Im done with comparing the the parameter and navigating to the desired view after the successfull login.
Im doing this at the [HttpPost] action of Index method.When the user after filling the login details(RegistrationNo,Date of Birth,Password) click on Login the values are compared from the database and on successfull login the navigation is taken to a certain page.Im successfull in doing this.
My issue is i want to save the cookies as well.
Can anyone provide me with some Example/Walk Through/Short Video Tutorial to do this task.
Please guide/help on this.

推荐答案

查看这些链接.它具有为MVC3创建登录"页面的分步过程.

http://msdn.microsoft.com/en-us/library/windowsazure/hh127794.aspx [ ^ ]

使用MVC 3实现自己的登录过程 [ ^ ]

问候,
Eduard
Check out these links. It has step-by-step procedures in creating a Login page for MVC3.

http://msdn.microsoft.com/en-us/library/windowsazure/hh127794.aspx[^]

Implement Own Login Process with MVC 3[^]

Regards,
Eduard


在ASP.NET MVC中使用cookie与ASP.NET Web应用程序没有什么不同.有很多资源可以解决这个问题.
Using cookies in ASP.NET MVC is no different than an ASP.NET Web application. There are many resources available that cover this topic.


这篇关于如何在Asp.Net MVC3中创建登录名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆