title: Can't select a disabled or unselectable menu item with asp.net
body: <p>I've researched a bit about this error i'm getting but with no luck.
  I'm using an asp.panel with a couple of controls inside of it. If some conditions are met, the panel will be visible or not. If it's visible, i'll have some textboxes and a button. When i click on the button, i get this error: "Can't select a disabled or unselectable menu item."</p>
  
  <p>here's the aspx code:</p>
  
  <pre><code>&lt;asp:Panel ID="pnlTrocaSenha" runat="server" Visible="false"&gt;
  
  
         &lt;asp:Label ID="Label3" runat="server" Font-Size="XX-Small"&gt;Este é o seu primeiro 
  acesso ao sistema. Favor cadastrar sua senha:&lt;/asp:Label&gt;
          &lt;br /&gt;
          &lt;asp:TextBox ID="txtSenha" runat="server" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:RequiredFieldValidator ID="rfvSenha" runat="server" ControlToValidate="txtSenha"
              Display="Dynamic" ErrorMessage="Senha Requerida"&gt;Senha Requerida&lt;/asp:RequiredFieldValidator&gt;
          &amp;nbsp; &amp;nbsp;&lt;br /&gt;
          &lt;asp:Label ID="Label4" runat="server" Font-Size="XX-Small"&gt;Confirme a senha&lt;/asp:Label&gt;
          &lt;br /&gt;
          &lt;asp:TextBox ID="txtConfirma" runat="server" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
          &lt;asp:CompareValidator ID="cvSenha" runat="server" ControlToCompare="txtSenha" ControlToValidate="txtConfirma"
              Display="Dynamic" ErrorMessage="*"&gt;Senha não bate com a confirmação&lt;/asp:CompareValidator&gt;
          &lt;asp:RequiredFieldValidator ID="rfvConfirma" runat="server" ControlToValidate="txtConfirma"
              Display="Dynamic" ErrorMessage="Confirmação Requerida"&gt;&lt;/asp:RequiredFieldValidator&gt;
          &lt;br /&gt;
          &lt;br /&gt;
          &lt;asp:Button ID="btnTrocar" runat="server" Text="Confirmar" CssClass="btnPadrao" OnClick="btnTrocar_Click" /&gt;&lt;br /&gt;
          &lt;asp:Label ID="lblMsg" runat="server" Text=""&gt;&lt;/asp:Label&gt;
      &lt;/asp:Panel&gt;
  
  protected void Page_Load(object sender, EventArgs e)
          {
              Session["estado"] = null;
              if(Request.QueryString["acao"] != "sair")
                  base.Page_Load(sender, e);
  
              if (!Page.IsPostBack)
              {
                  if (Request.QueryString["acao"] == "sair")
                  {
                      Sair();
                  }
  
                  var usuario = (CUsuario) Session["usuario"];
                  if (!usuario.getSenhaAlterada())
                  {
                      pnlTrocaSenha.Visible = true;
                  }
                  else
                  {
                      pnlTrocaSenha.Visible = false;
                  }
              }
          }
  
  protected void btnTrocar_Click(object sender, EventArgs e)
          {
              if (Page.IsValid)
              {
                  if (!Util.ValidarSenhaForte(txtSenha.Text))
                  {
                      lblMsg.Text = "A senha precisa ter no minimo 8 caracteres e conter numeros e letras";
                      return;
                  }
                  string senhaCriptografada = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtSenha.Text, "MD5");
                  var usuario = (CUsuario) Session["usuario"];
                  DBAccess dao = new DBAccess();
                  usuario.setSenha(senhaCriptografada);
                  usuario.setSenhaAlterada(true);
                  dao.AtualizarUsuario(usuario, Session["idUsuario"].ToString(), (CUsuario)Session["usuario"]);
                  pnlTrocaSenha.Visible = false;
              }
          }
  </code></pre>
  
  <p>I thought that this error would only show up if you are working with asp.menu....thanks in advance.</p>