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 :
- NRIC
- Teacher-In-Charge1
- CIP Event
- Hours
- etc...
Teacher Table :
- NRIC
- 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,
[imgnothumb]http://bytes.com/attachments/attachment/4245d1290761711/1.jpg[/imgnothumb]
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 :
- NRIC
- Teacher-In-Charge1
- CIP Event
- Hours
- etc...
Teacher Table :
- NRIC
- 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,
Code:
protected void DetailsView1_DataBound(object sender, EventArgs e)
{
TextBox txtBox = (TextBox)this.DetailsView1.FindControl("TextBox1");
txtBox.Text = User.Identity.Name.ToString();
}