title: Asp.net MultiView /check ActiveViewIndex With Javascript Or jQuery
body: <p>Why does the below alert always show me null?</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Keyup._Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  
  &lt;%--    &lt;script src="JQuery/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;--%&gt;
              &lt;script type="text/javascript"&gt;
  
                  document.onkeyup = onkeyupOfDocument;
  
                  function onkeyupOfDocument(evt) {
                      //var MultiView = $("*[id$='TextBox1']"); 
                      var MultiView = document.getElementById("MultiView1");
                      alert(MultiView);
                  }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"&gt;
              &lt;asp:View ID="View1" runat="server"&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;/asp:View&gt;
              &lt;asp:View ID="View2" runat="server"&gt;
              &lt;/asp:View&gt;
          &lt;/asp:MultiView&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After solving null problem how can I check <code>ActiveViewIndex</code> with JavaScript or jQuery?</p>
  
  <p>It seems </p>
  
  <pre><code>if(MultiView.ActiveViewIndex == 0)
  </code></pre>
  
  <p>is not true!!</p>
  
  <p>Thanks in advance.</p>