我一直在寻找这个网站的答案,但我卡住了。JQuery Mobile + ASP.NET - 不触发按钮
有人可以帮助我解决以下问题。我有一个用VB编写的ASP.NET项目,并使用jQuery Mobile 1.2.0版本。
我有一个默认页面,有2个按钮(登录/约),这些工作并重定向到登录页面。然而,在登录页面上,登录按钮事件不会触发 - 它只是重新指向默认页面。使用简单的重定向按钮在关于页面上也是如此。
但是,如果我刷新登录页面然后按钮的工作?
下面是代码:
<%@ Page Title="Login" Language="vb" EnableEventValidation="false" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="login.aspx.vb" Inherits="Sequencing.login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="page_title" runat="server">
Login
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="pageheader" runat="server">
<h1>Login</h1>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="body" runat="server">
<asp:LinkButton ID="LinkButton1" data-role="button" data-rel="dialog"
data-transition="pop" runat="server"
Visible="False">LinkButton</asp:LinkButton>
<div align=center class="ui-bar ui-bar-c">
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/McD_logoimage.png" /><br />
<h3>Planning the Future</h3>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Login ID="Login1" DestinationPageUrl="~/user/Main.aspx" runat="server" Width="100%">
<LayoutTemplate>
<asp:TextBox ID="UserName" runat="server" value placeholder="Username"></asp:TextBox>
<asp:RequiredFieldValidator ID="cvUserName" runat="server" ControlToValidate="UserName" ToolTip="User Name is required." ValidationGroup="Login1" Display="Dynamic"> </asp:RequiredFieldValidator>
<asp:TextBox ID="Password" runat="server" type="password" runat="server" value placeholder="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="cvPassword" runat="server" ControlToValidate="Password" ToolTip="Password is required." ValidationGroup="Login1" Display="Dynamic"> </asp:RequiredFieldValidator>
<asp:CheckBox ID="RememberMe" runat="server" Text="Remember me!" />
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
<asp:Button ID="LoginButton" runat="server" data-role="button" data-theme="b" CommandName="Login" Text="Log In" ValidationGroup="Login1" onclick="LoginButton_Click" />
</LayoutTemplate>
</asp:Login>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
感谢您的帮助提前。
而且这个 - 我已经看过了如何禁用jQuery Mobile的和添加的代码到网站母版,其中jQuery的引用 - 但仍然没有喜悦!
<script>
$(document).bind("mobileinit", function() {
//apply overrides here
$.mobile.ajaxEnabled = false;
});
</script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"> </script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
其他人有什么想法吗?
我们无法帮您处理该代码。也许只有当你拥有它的时候。 jQuery手机有时会将页面移动到一个动态创建的div中,这通常在表单的外面,这就是没有被解雇的原因。 – Aristos
对不起,我不明白你的意思?我已经发布了这个网站 - 而且它也不在现场工作。 – Steve
你可以给我们的网址来测试它吗?并看看出了什么问题。 – Aristos