asp.net - Get the Value of an asp:HiddenField using jQuery -
asp.net - Get the Value of an asp:HiddenField using jQuery -
i have 2 pages. first page, open modal querystring holds value of client name. utilize set hiddenfield on modal opened.
i need textbox on new modal display value has been sent through first screen.
i've tried getting value using:
var hv = $('hidclientfield').val();`
but doesn't seem work.
this hidden field:
<asp:hiddenfield id="hidclientname" runat="server" />`
i set in code behind on page_load this:
hidclientname.value = request.querystring["client_name"] ?? "";`
any ideas much appreciated.
try of following
if asp.net command , javascript both on same page, use
var hv = $("#"+ '<%= hidclientfield.clientid %>').val();
if want access command js file, then
// 'id$' cause jquery search command id ends 'hidclientfield' var hv = $('input[id$=hidclientfield]').val();
you can utilize class name selector accomplish same. check out this similar question.
in asp.net, controls id mangled. because of code not working.
hope works you.
jquery asp.net hiddenfield
Comments
Post a Comment