How to access value from login control txtbox asp.net 2

ASP.NET 2
Visual Studio 2005
win xp

Hi I want to retrieve the username from the login control txtbox when a user logs on
and store in a variable.

tried  

Dim username As String
        username = Login1.FindControl("UserName")

but get following error

Error      2      Value of type 'System.Web.UI.Control' cannot be converted to 'String'.      

D
deNZityAsked:
Who is Participating?
 
kraffayConnect With a Mentor Commented:
Try this:

username = Login1.UserName
0
 
deNZityAuthor Commented:
thanks :)
0
All Courses

From novice to tech pro — start learning today.