Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a usercontrol with textbox. i have to set textbox property readonly is true. But it is not working. Help me
XML
<asp:TextBox id="Txtamt" CssClass="TextBoxNormal" Width="120px" ReadOnly="True" runat="server">
Posted
Updated 17-Apr-13 19:33pm
v3
Comments
Sergey Alexandrovich Kryukov 18-Apr-13 0:26am    
Not enough information. How about a code sample?
—SA
Ankur\m/ 18-Apr-13 1:02am    
The code is correct. Can you post the generated HTML markup?
AmitGajjar 18-Apr-13 1:36am    
try with code behind to make your textbox readonly like Txtamt.Attributes.Add("readonly","readonly")
Thanks7872 18-Apr-13 1:55am    
@Sergey Alexandrovich Kryukov: I am seeing your comment almost in all questions.I want to bring to your notice that not everyone here is EXPERT and expert at representation.Sometimes its ok,but in every question you are asking NOT ENOUGH INFORMATION,DO HARD WORK,WE ARE NOT HERE TO WORK FOR YOU....this are the common comments by you as i have seen so far.I think it shouldnt be like this. If you dont understand the question leave it,or ask the way it should be. sometime it also not clear what YOU ARE ASKING FOR? we can make things better if we look forward to this issue.
Maciej Los 18-Apr-13 2:30am    
Rohan Leuva, please, don't abuse! As much as i know, Sergey uses comments to get more information about issue.

1 solution

Use as follows:

C#
<asp:textbox id="Txtamt" cssclass="TextBoxNormal" width="120px" enabled="false" runat="server" xmlns:asp="#unknown"></asp:textbox>
 
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