title: Assign int value to Hidden field
body: <p>I need to assign int value to hidden field.But it fails</p>
  <p>Here goes my code</p>
  <p>ASP.NET</p>
  <pre><code>&lt;asp:HiddenField ID=&quot;hdnCId&quot; runat=&quot;server&quot; /&gt;
  </code></pre>
  <p>C#</p>
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          int Id= 0;
          if (Request.QueryString[&quot;Id&quot;] != &quot;&quot; &amp;&amp; Request.QueryString[&quot;Id&quot;] != null)
          {
              ChurchId = Convert.ToInt32(Request.QueryString[&quot;Id&quot;]);
          }
          else
          {
              Id = -1;
          }
  
          hdnCId.Value =Id;
      }
  }
  </code></pre>