Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii,


<asp:TextBox ID="txtComment" CssClass="Form_InputField" TextMode="MultiLine" Rows="3" Width="98%" runat="server" Text='<%# Eval("Comment")%>' Enabled="false" Font-Bold="true" Font-Names="Arial">

previously what i am doing is .. when user click on edit i make this text box enabled and he can change the text and then update it and textox set to enabled=false again ...


this time my clients requirement is ... when i click on edit it shows an textbox to add coments in it .. but whn i say update it .. then it will convert it into label and displays the updated comment ... how can i dot that
Posted

1 solution

You can have two controls here. One is label and other is textbox. Show only one at a time. When user click on edit show the textbox, user enter the data and update . Then copy the data to the label and show it and hide textbox as well.
 
Share this answer
 
Comments
Torakami 30-Jul-13 6:01am    
any idea how to select all text when user click on edit button .. i mean i applied your method .. but now what i want to do is .. when user cliks on edit button he will get textbox with all text selected
Brij 30-Jul-13 6:11am    
You can do it by javascript. You can try by using onfocus="this.select()" or similar
Torakami 30-Jul-13 6:22am    
Can you shpw me the code in more detail .. i mean where to call it that function
♥…ЯҠ…♥ 30-Jul-13 6:38am    
i think this "http://lmgtfy.com/?q=javascript+to+select+all+text+in+textbox+in+asp.net" would help you a bit.

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