how to set asp.net hidden field in javascript and access the value in c# code behind -


i'm trying set hidden field value in js think works fine approachl

  <asp:hiddenfield id="hflatsw" runat="server" />     var latsw = bounds.getsouthwest().lat();    $('#<%=hflatsw.clientid %>').value = latsw; 

trying access value on asp.net button click in code behind gives me null value, idea happening in postback , why i'm not able access value set javascript? in advance, laziale

.value isn't jquery property. use .val():

$('#<%=hflatsw.clientid %>').val(latsw); 

or without jquery:

document.getelementbyid('<%=hflatsw.clientid %>').value = latsw; 

Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -