title: call a DIV from my C# code behind
body: <p>I have been trying to call a DIV from my C# code behind...I have a conditional statement and if the condition passes then I need for the DIV to be called...the DIV will then trigger my CSS3 modal in my HTML....however...I can't seem to get the DIV Modal to fire...would someone be able to give me some advice???  Code is below...</p>
  
  <p>I am new to C# so to many this may be a simple fix and a novice question...but I do appreciate your help...thank you...</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;asp:TextBox ID="TextBox1" name="last_name" runat="server" style="font-size:28px" class="content" placeholder="Enter Juror ID Number" maxlength="6" size="20" onfocus="jsKeyboard.focus(this);clean(this);" autofocus ontextchanged="IsValidNumber"&gt;
  
  &lt;/asp:TextBox&gt;
  &lt;/div&gt;
  
  
  &lt;center&gt;
  &lt;table cellspacing="0" cellpadding="0"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;div class="juror_number_back_button_container"&gt;
  &lt;asp:Button id="Button1" 
             Text="Back"
             OnClick="Button1_Click" 
             runat="server" /&gt;
             &lt;/div&gt;
  &lt;/td&gt;
      &lt;td&gt;&lt;div class="juror_number_continue_button_container"&gt;
  &lt;asp:Button id="Button2" 
             Text="Continue"
             OnClick="IsValidNumber" 
             runat="server" /&gt;
             &lt;/div&gt;
  &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;
  
  &lt;div id="feedback"&gt;&lt;/div&gt;
  &lt;div id="virtualKeyboard"&gt;
  &lt;/div&gt;
  &lt;div id="openModal" class="modalDialog" runat="server"&gt;
      &lt;div&gt;
          &lt;a href="#close" title="Close" class="close"&gt;&lt;/a&gt;
          &lt;center&gt;&lt;p class=" font_style_menu"&gt;Is this your Name and DOB?&lt;/p&gt;
          &lt;p class=" font_style_menu"&gt;John M Doe&lt;/p&gt;
          &lt;p class=" font_style_menu"&gt;7/12/1972&lt;/p&gt;
          &lt;p&gt; &lt;span style="font-size:30px"&gt;If No, please press No to Re-Enter Juror Number from your summons.&lt;/span&gt;&lt;/p&gt;&lt;/center&gt;
  
  &lt;center&gt;
  &lt;table cellspacing="0" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;td&gt;
  &lt;div class="modal_yes_button_container"&gt;
  &lt;form method="post" name="" action="checkin.aspx"&gt;
  &lt;input type="submit" name="Yes" value="Yes" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/td&gt;
  &lt;td&gt;
  &lt;div class="modal_no_button_container"&gt;
  &lt;form method="post" name="" action="#close"&gt;
  &lt;input type="submit" name="No" value="No" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/center&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>C# Code Behind</p>
  
  <pre><code>protected void IsValidNumber(object sender, EventArgs e)
      {
  
        int num;
  
        if (Int32.TryParse(TextBox1.Text, out num) &amp;&amp; (TextBox1.Text.Length == 6))
        {
          DisplayDiv(true);
        }
  
        else
        {
  
          Response.Redirect("error_page_b.aspx");
        }
      }
  
      private void DisplayDiv(bool isShow)
      {
        openModal.Visible = isShow;
      }
    }
  </code></pre>