我有 2 个母版页 1 个在管理员内部和 1 个在管理员外部
当我从该文件复制到 adminmaster 时,管理主页之外的 jquery 函数正在触发特定事件和相同的功能,我得到错误
microsoft jscript 运行时错误:'functionname'未定义
这里的区别是admin master的内容页面也具有jquery功能,并且只有这些功能在viewsource页面或firefox->firebug->script中可用
adminmasre 里面的功能根本不可用。
这是我的 admin.master 代码
<asp:ContentPlaceHolder ID="scriptadmin" runat="server">
<script type="text/javascript">
$(document).bind("mobileinit", function () {
$.mobile.ajaxEnabled = false;
});
$("#Logout").click(function (e) {
e.stopImmediatePropagation();
e.preventDefault();
});
function test() {
alert("Test");
}
function Dologout() {
// Sys.Services.AuthenticationService.logout(null, OnLogoutSuceeded, OnLoginFailed, null);
// return false;
}
// function OnLogoutSuceeded(result, userContext, methodName) {
// alert('You have been successfully logged out of the application...');
// // window.location.href("Login.aspx");
// }
</script>
</asp:ContentPlaceHolder>
</body>
</html>
这里是 div 我把这个函数称为 Back Logout
内容页面是:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="XYZ.Admin.Default" MasterPageFile="~/Admin/admin.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<h3 class="MainHeader">Upload Excel file to convert into database </h3>
<asp:Label ID="lblmsg" runat="server" Text="" CssClass="message" ></asp:Label>
<div class="file-upload-btn">
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
<div id ="ButtonWrapper" >
<asp:Button ID="btnUpload" runat="server" Text="Upload" data-role="none" onclick="btnUpload_Click" />
</div>
</asp:Content>
<asp:Content ID="script1" ContentPlaceHolderID="scriptadmin" runat="server">
<script type="text/javascript">
$(function () {
$("#btnUpload").removeClass('ui-btn-hidden ui-btn-inner ui-submit ui-btn ui-shadow ui-btn-corner-all ui-btn-up-b');
$("#FileUpload1").removeClass('ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow ui-body-c file-upload-btn');
});
</script>
</asp:Content>
任何帮助,将不胜感激!!