Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2010, 03:26 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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
  #2 (permalink)  
Old March 1st, 2010, 03:35 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

You can capture the user name with the following code:

User.Identity.Name

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old March 1st, 2010, 03:57 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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
  #4 (permalink)  
Old March 1st, 2010, 04:06 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

They are already unique by design (per application, that is).

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #5 (permalink)  
Old March 1st, 2010, 07:01 PM
Authorized User
 
Join Date: Mar 2010
Posts: 65
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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
  #6 (permalink)  
Old March 1st, 2010, 07:09 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Take a look at my reply in the other thread. Membersjip.GetUser() gives you a reference to the current user.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net login error akshay144 ASP.NET 3.5 Basics 1 August 3rd, 2009 08:18 PM
asp.net login control kulkarnimonica ASP.NET 2.0 Professional 6 September 25th, 2007 05:22 PM
ASp.net 2.0 login name control kulkarnimonica ASP.NET 2.0 Professional 12 July 11th, 2007 12:42 AM
login control problem (asp.net2.0 website progr..) rookie07 ASP.NET 2.0 Basics 1 June 22nd, 2006 09:25 AM
ASP.NET Login Control Question adnanjamil ASP.NET 2.0 Professional 1 April 30th, 2006 07:48 PM



All times are GMT -4. The time now is 11:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.