 |
| ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 1st, 2010, 03:26 PM
|
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
ASP.net Login Name Control
Hi,
I am working on with a web site. That allow users to log in.After they logged in, they are redirected to a new page where i have attached a login name control to show there login status.In that new page i have my own custom data which allows users to enter some information that will be stored in my custom database.
Along with the other informtion i also want the LOGIN NAME control to store the content ie the User's name, to my custom database. But i could not extract the content from the Login name Control.
I also tried
Login name1.Format String to store in my database. But it stored {0 } and not the exact logged in username.
Can you please help me how to extact the user name from Login name Control.
-Thanks Gayathri79
|
|

March 1st, 2010, 03:35 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
You can capture the user name with the following code:
User.Identity.Name
Cheers,
Imar
|
|

March 1st, 2010, 03:57 PM
|
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Oh Thanks a lot. It Worked.
One more Question. I want to set Validation for User name as Unique in Create User Wizard. Is there a property for that?
-Gayathri79
|
|

March 1st, 2010, 04:06 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
They are already unique by design (per application, that is).
Cheers,
Imar
|
|

March 1st, 2010, 07:01 PM
|
|
Authorized User
|
|
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Display Create User Wizard information.
I tried to display the Create User Wizard Information which user entered when signing up. But i could do that only with the Data Bound controls like Details view and Grid view.
Can i extract the membership information and display in text box control for editing? How can i do that? Please help.
Thanks
-Gayathi79
|
|

March 1st, 2010, 07:09 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Take a look at my reply in the other thread. Membersjip.GetUser() gives you a reference to the current user.
Cheers,
Imar
|
|
 |