By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,086 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,086 IT Pros & Developers. It's quick & easy.

How to auto generate the name of the user who is logged in?

P: 3
How do you auto generate the name of the user who is logged in?

For example,
I had a Detail View to allow the user to insert the data, and i have a column named "Teacher In Charge 1".
I wish to grab the name from another table called "Teacher"...

Table :
- Teacher-In-Charge1
- CIP Event
- Hours
- etc...

Teacher Table :
- Name
- Gender
- Class
- Course
- The user used its NRIC to log on to the web site.
Other than using the code below to auto generate the name,
Expand|Select|Wrap|Line Numbers
  1. protected void DetailsView1_DataBound(object sender, EventArgs e)
  2. {
  3.    TextBox txtBox = (TextBox)this.DetailsView1.FindControl("TextBox1");
  4.    txtBox.Text = User.Identity.Name.ToString();
  5. }

Attached Images
File Type: jpg 1.jpg (42.9 KB, 92 views)
Nov 26 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.