Click here to Skip to main content
15,900,565 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table for employee details.
I have several columns including personal details with username.
I want employees to edit only personal info and not the username.
I have used details view for that and make username READONLY field.

But my problem is after editing the fields when I click update, the READONLY username field takes NULL value. Why is it so? What can I do to prevent the username taking the NULL value and remain as it is?

I am not able to understand what the problem is.
Posted
Updated 31-Jan-11 22:38pm
v2
Comments
shakil0304003 1-Feb-11 4:52am    
Use google 1st!!!

1 solution

protected void Page_Load(object sender, EventArgs e)
{
txtStartDate.Attributes.Add("readonly","readonly");
}

If set ReadOnly property like this in code behind now we have a chance to get the data from that read only control without giving chance to user to enter data in textbox. For more you can see this
Click
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900