Last post Sep 04, 2008 01:29 PM by mary154458
Sep 04, 2008 10:46 AM|mary154458|LINK
I would like to populate a text box with the user's user id.
I am using the login controls to and roles in order to create pages that users can only view once they are logged in. On one of those pages, I want to populate a text box with the user's user id, so that I can save it to a different database table along
with some other information. (This is the way I am tying the user's information together is by user id).
I have tried to do this, but I don't even know what session variable name is being used for user id in visual studio. My code behind is C#. Does anyone know how to do this??
Sep 04, 2008 01:13 PM|seven_of_nine|LINK
Assuming by User Id you mean the name that the user types into the User Name box on the login control, you can access the logged in user's name through User.Identity.Name. As this is a string, you can assign it directly to the text box's Text
Hope this is what you are looking for...
Sep 04, 2008 01:29 PM|mary154458|LINK