c# - Disabled textbox value is getting lost on click of a button -


i'm using following dropdown & mapping value textbox.

<asp:dropdownlist id="ddlcntry" runat="server" height="24px" width="160px"           onchange="country();">         <asp:listitem>select country</asp:listitem>         <asp:listitem>india</asp:listitem>         <asp:listitem>usa</asp:listitem>         <asp:listitem>uk</asp:listitem> </asp:dropdownlist>   <asp:textbox id="txtcntryrisk" runat="server"          ontextchanged="txtcntryrisk_textchanged" width="153px"          enabletheming="true" enabled="false"></asp:textbox> 

i have calculation button, when click on button mapped textbox value gets lost. want textbox disabled value cannot changed. tried using readonly=true property in vain. session, viewstate not working.

but when enable textbox, it's working fine, no loss of value. help?? thanx in advance. :-)

set readonly attribute server side:

txtcntryrisk.attributes.add("readonly","readonly"); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -