title: IF Statement Always True
body: <p>I have a radwindow that I use to show error messages to users in an application.<br>
  My goal is as below;<br>
  If the message is not a warning/error I want user to be redirected when they click "OK" on the popped up radwindow.
  To accomplish this, I'm setting HiddenField value to "1" when the operation is successful and to "0" when the operation fails.
  My problem is that when I check the HiddenField value on the client-side the IF statement always returns true, and the page is redirected.</p>
  
  <p>Here are the cases when I set the hiddenfield value and set the radwindow message;</p>
  
  <pre><code>if(x)
  {
     hfPasswordWarning.Value = "0";
     ShowMessage(MessageResource.ChangePasswordAuthenticateError,false);
  }
  
  else
  {
     hfPasswordWarning.Value = "1";
     ShowMessage(MessageResource.ChangePasswordSuccess,true);
  }
  </code></pre>
  
  <p>And the client-side code which I'm having issues with, IF statement is always true;</p>
  
  <pre><code>var hv = $('#hfPasswordWarning').val();
  
      if (hv.val = "1") {
          window.location = "../Main/Login.aspx";
      } else {
          return false;
      }
  </code></pre>
  
  <p>I've added an Alert("xx") to check if it ever gets into else statement but It doesn't. I've tried to simplify the explanation of my problem as much as I can. Thank you for your understanding.</p>