I'm trying to integrate "jquery.mmenu" into a Visual Studio project.
It looks like an "asp: Button" does not work inside a "nav mmenu".
An "asp: LinkButton" also does not seem to work in full.
Take for example the login inside the "nav mmenu" like the following:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="test._default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="Scripts/jquery-2.1.4.min.js"></script>
<script src="Scripts/jquery-ui-1.11.4.min.js"></script>
<script src="Scripts/jquery.mmenu.min.all.js"></script>
<link href="Content/themes/base/all.css" rel="stylesheet" />
<link href="Content/themes/base/jquery.mmenu.all.css" rel="stylesheet" />
<title></title>
<script>
$(document).ready(function () {
$("#login").mmenu({
});
});
</script>
</head>
<body>
<div>
<form id="form1" runat="server">
<a href="#login">Open login pannel</a><br />
<asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LoginText="login" LogoutText="logout" LogoutPageUrl="~/" /><br />
<nav id="login">
<div>
<asp:Label ID="UserNameLabel" runat="server">User:</asp:Label><br />
<asp:TextBox ID="UserNameTextBox" runat="server"></asp:TextBox><br />
<asp:Label ID="PasswordLabel" runat="server">Password:</asp:Label><br />
<asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"></asp:TextBox><br />
<asp:Button ID="LoginButton" runat="server" ClientIDMode="Static" Text="Login Button" OnClick="LoginButton_Click" /><br />
<asp:LinkButton ID="LoginLinkButton" runat="server" ClientIDMode="Static" OnClick="LoginLinkButton_Click">Login LinkButton</asp:LinkButton>
</div>
</nav>
</form>
</div>
</body>
</html>
The code is as follows:
using System;
using System.Web.Security;
namespace test
{
public partial class _default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Membership.ValidateUser(UserNameTextBox.Text, PasswordTextBox.Text))
{
FormsAuthentication.RedirectFromLoginPage(UserNameTextBox.Text, false);
}
}
protected void LoginLinkButton_Click(object sender, EventArgs e)
{
if (Membership.ValidateUser(UserNameTextBox.Text, PasswordTextBox.Text))
{
FormsAuthentication.RedirectFromLoginPage(UserNameTextBox.Text, false);
}
}
}
}
Asp: Button does not do postback.
Asp: LinkButton does not get login.
Any ideas?
Thank you.