ashok kumar

ashok kumar

  • NA
  • 89
  • 36.1k

Unable to access the hidden state variable from code behind

Aug 29 2013 9:51 AM
Hi,
 when i access my hidden variable from my code behind iam getting the value as 0 instead of failed ,i checked by putting alert,its entering into the if loop.so no problem there.

 function CheckDllsTxt() {
                  $('select').each(function () {
                      if (($(this).val()) == '-1') {
                          document.getElementById('<%=HdnValidation.ClientID%>').value = 'Failed';
                    
                        
                      }

                  });
<asp:HiddenField ID="HdnValidation" Value="0" runat="server"/>
i placed it both inside and outside of the update panel

C#:
  ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", "CheckDllsTxt();", true);
            if (HdnValidation.Value == "Failed")
            {
            }
            else
            {
            }
the Function CheckDllsTxt(); is also invoking,but iam getting HdnValidation.Value=0,pls help me out


Answers (3)