Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Luck

Status
Not open for further replies.

chadau

Programmer
Nov 14, 2002
155
US
This returns nothing whenever it is called:

Me.TextBox1.Text = User.Identity.Name

Please help me understand why?
 
Do you mean that you get an error, or nothing shows up in the text box?

Either way, User.Identity.Name is obviously not getting filled, or the value its filled with is an empty string

D'Arcy
 
Hi chadau

If you are getting an empty string returned back it is probably because you do not have any authentication configured in your applications web.config file.

I have an asp.net program setup to use FORMS authentication

<authentication mode=&quot;Forms&quot; />

and when i execute the command

response.write(User.Identity.Name)

my username is returned.

Try adding the following lines of code to your app to see your authentication settings

Response.Write(&quot;<br>User.Identity.AuthenticationType=&quot; & User.Identity.AuthenticationType)

Response.Write(&quot;<br>User.Identity.IsAuthenticated=&quot; & User.Identity.IsAuthenticated)

Response.Write(&quot;<br>User.Identity.Name=&quot; & User.Identity.Name)



For more info about Forms authentication check out this article


Hope that clarifies the situation for you

S.


(The more ASP.NET I do, the more Javascript I find myself using)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top