如何使用C#在asp.net中编写一个简单的登录页面? [英] how to code a simple login page in asp.net using C#?

查看:112
本文介绍了如何使用C#在asp.net中编写一个简单的登录页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:)我想为asp.net网站编写一个简单的登录页面,有人可以帮我吗?

:) i wat to code a simple login page for an asp.net site can any one help me out?

推荐答案

在ASP.net上读书使用C#将是一个不错的开始.
Reading a book on ASP.net with C# would be a good start.


使用登录控件(即
)非常容易
首先,从文本框中显示的登录工具"中拖放一个登录控件.

然后在菜单栏中转到网站,选择ASP.NET配置.
第三步是配置您的网站,因此只需单击显示安全性的超链接,页面就会出现

只需点击
使用安全设置向导逐步配置安全性.

单击下一步,然后您将看到一个页面,其中将有两个单选按钮,必须选择从Internet"选项,然后单击下一步",您将再看到一个页面,其中显示高级提供程序"设置,只需单击下一步",下一步"将询问您角色,如果您要在网页中定义角色,则可以定义角色,如果不需要,则单击下一步

您将看到的下一个屏幕将是创建用户页面继续创建一个或两个用户,完成后单击下一步,然后单击完成

现在,创建另一个页面,例如AfterLogin.aspx,并将登录页面属性设置为AfterLogin.aspx,将目标页面网址"设置为

运行Login.aspx,然后输入您创建的用户名和密码,请记住,密码选项使用一个字母数字单词,因此您可以设置密码,例如r @ 12345或类似的内容

一旦找到有用的答案,就对我的答案进行评分

谢谢与问候
基:rose:
It is very easy u have to use the login controls i.e.

First drag and drop a login control from the Login Tool which is present in the text box

Then in the menubar go to the website select ASP.NET configuration.
Third step would be configuring your website so just click on the hyperlink which says security and the a page would apperar

just click on the
Use the security Setup Wizard to configure security step by step.

click on next and then u will see a page which will have two radio buttons kust select the From the Internet option and then click Next, you will see one more page which says Advance Provider setting just click Next, The Next Page will ask you for roles if u want roles in ur webpage u can define roles and if not then click next

Next Screen which you will see would be a create user Page go on create one or two user and when ur done click next and then Finish

Now Create another page say AfterLogin.aspx and set the Login controls property which says Destination Page Url to AfterLogin.aspx

Run the Login.aspx and then enter the user name and password you created remember that the password option takes one alpha numeric word so u can set the password like r@12345 or something like that

Do Rate my answer once you find it useful

Thanks & Regards
Radix :rose:


这篇关于如何使用C#在asp.net中编写一个简单的登录页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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