c# - How to change the value of an asp:textbox from javascript -
i have asp:textbox
<asp:textbox id="newname" runat="server" />
and when user clicks "cancel" button, want erase whatever in text box making value "". if input field of type text, in javascript:
document.getelementbyid('newname').value= "";
but can't because asp:textbox.
when asp:textbox rendered ui, yes, input field of type text. part may issue id, can set using clientidmode:
<asp:textbox id="newname" runat="server" clientidmode="static" />
renders to:
<input type="text" id="newname" />
and javascript use should work perfectly.
Comments
Post a Comment