如何制作一个类似于Codeproject的登录框? [英] How to make a login box like Codeproject?

查看:69
本文介绍了如何制作一个类似于Codeproject的登录框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想像一个Codeproject一样使用一个登录框.对于未登录的Codeproject所有网页中的访问者,登录框都是可见的.用户登录后,将删除登录框,并用linkButton代替,该框显示用户名并允许他注销.

我可以向希望登录的用户显示另一个网页,一旦他们登录,他们的名字就会出现在所有网页中.我通过使用Session(但不使用MasterPage)实现了这一目的.我希望创建一个类似于此站点的登录框. Codeproject是否通过使用MasterPage实现此目的?我试图动态更改MasterPage控件,但无法在同一项目的所有页面中反映出更改.

我需要一些有关如何启动它的想法.

我使用VS2005进行项目.

Hello everyone,

I wanted to make a login box like one Codeproject uses. The login box is visible to visitors in all webpages of Codeproject who do not login. Once the user logins, the login box is removed and it is replaced by linkButton which shows user name and allows him to log out.

I am able to show the a different webpage to users who wish to login and once they login, their name comes up in all webpages .I achieved this by using Session (but without using MasterPage). I wish to create a login box like this site. Does the Codeproject achieves this by using a MasterPage? I tried to change the MasterPage controls dynamically, but i am unable to reflect the change in all pages of the same project.

I need some Ideas on how to start it.

I use VS2005 to do my projects.

推荐答案

ASP.NET内置了Login控件,该控件几乎可以完成您想做的事情.除非它是更好的轮子,否则不要重新发明轮子.
ASP.NET has built in Login controls that pretty much does what you are trying to do. Don''t re-invent the wheel unless it is a better wheel.


正如Shameel所说的那样,它已经存在-请查看msdn [ ^ ]有关如何使用登录控件的信息.
As Shameel says this already exists - check out msdn[^] on how to use the login controls.


感谢所有尝试帮助我的人.我终于想通了.我使用了Session变量和MasterPage load事件来解决该问题.如果其他人想知道我是怎么做的,请问我,我很乐意告诉您.
Thank you to all who tried to help me. I have finally figured it out. I used Session variable and MasterPage load event to solve the problem. If someone else wants to know how i did it, then ask me and i would be happy to tell.


这篇关于如何制作一个类似于Codeproject的登录框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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