我有一个ASP.Net WebForms项目(在VS 2013中使用C#),在其中我称为AJAX Popup Extender的实例。我已经使用NuGet添加了AjaxControlToolKit和AjaxControlTookitStaticResources。最近,该弹出表单已停止显示。当我尝试通过单击目标控件来显示弹出窗口时,使用FireFox作为目标浏览器时它不会出现。 Firefox控制台显示许多错误,如下所示。第一个错误是
/* Minification failed. Returning unminified contents.
(6,25981-25982): run-time error JS1014: Invalid character: \
(6,25981-25982): run-time error JS1003: Expected ':': \
(6,44631-44635): run-time error JS1197: Too many errors. The file might not be a JavaScript file: 'ss'
(6,25816-25829): run-time error JS1301: End of file encountered before function is properly closed: function(e,b)
(6,44635-44636): run-time error JS1004: Expected ';
': Z
(6,45814-45815): run-time error JS1195: Expected expression: ^
(6,45815-45816): run-time error JS1197: Too many errors. The file might not be a JavaScript file: |
*/
与弹出窗口有关的代码是
CancelControlID="cmdCloseButton" BackgroundCssClass="modalBackground"> </cc1:ModalPopupExtender>
<asp:Button ID="cmdTest" runat="server" Text="Test Popup" Width="177px"/>
<%--<asp:Button ID="cmdTest" runat="server" Text="Test Popup" Width="177px" Style="display:none" />--%>
<asp:Panel ID="Panl2" runat="server" Width="280px" Height="180px" CssClass="modalPopup" align="left" style="display:none">
<br />    Need to caption multiple photos? <br /><br />
    Click <a href="Why Use the Windows Downloadable Application.htm" target="_blank">here</a> for details of desktop app. <br /><br />
    To hide this message and watermark on <br />
    captioned photo, <a href="BuyLicense.aspx" target="_blank">buy License</a>.
<asp:Button ID="cmdCloseButton" runat="server" Text="Close" CssClass ="closebutton"
OnClick ="cmdCloseButton_Click" formnovalidate="formnovalidate" UseSubmitBehavior="false"/>
</asp:Panel>
Site.Master代码为
%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="CaptionProWebMob.SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title><%: Page.Title %> Caption Pro Web</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:BundleReference runat="server" Path="~/Content/css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<asp:ContentPlaceHolder runat="server" ID="HeadContent" />
</head>
<body>
<form runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="False">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=272931&clcid=0x409 --%>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<%--<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />--%>
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>
<header>
</header>
<div id="body" ondragstart="dragStartHandler1(event);">
<asp:ContentPlaceHolder runat="server" ID="FeaturedContent" >
</asp:ContentPlaceHolder>
<section class="content-wrapper main-content clear-fix">
<asp:ContentPlaceHolder runat="server" ID="MainContent" >
</asp:ContentPlaceHolder>
</section>
</div>
<footer>
<div class="content-wrapper">
<div class="float-left">
<p>© <%: DateTime.Now.Year %> - Caption Pro Web</p>
</div>
</div>
</footer>
</form>
</body>
</html>
如果将EnableCDN =“ true”添加到在Site.Master.aspx中定义ScriptManager1的行中,如下所示
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="False" EnableCdn="true" >
然后弹出屏幕显示确定。
但是,如果VS项目以管理员身份运行(至少对于Firefox),使用AJAX AsyncFileUpLoad将文件拖放到主窗体上现在不起作用(至少对于Firefox):如果VS项目不是以管理员身份运行,则可以正常工作。