繁体   English   中英

C# ASP.NET JQuery 脚本在部署到 Z5DA5ACF461B4EFB7E726EC861065B21 后未加载

[英]C# ASP.NET JQuery Script Not load After Deployed to IIS 10

I had a Master page with iFrame in it and 1 of the iFrame programs is using JQuery Ajax AutoComplete function for a TextBox. 该程序在 VS2017 开发中运行良好。 但是,在部署到 IIS 10 后,TextBox AutoComplete 事件不起作用。在 iFrame 页面上检查了 TextBox,发现缺少 ZC1C425268E68385D1AB5074C17A94F 调用中的 Chrome 部分中的屏幕截图。 我检查了所有包含的脚本链接都可以查看。 曾尝试搜索许多解决方案,但没有解决我的问题。 欢迎任何建议解决方案或建议,并提前致谢。

在此处输入图像描述

 $(document).ready(function () { $("#txtAccountNum").focus(function () { $("#txtAccountName").focus(); }); }); var RootUrl = window.location.protocol + "//" + window.location.host; $(function () { $(".custSearch").autocomplete({ source: function (request, response) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: RootUrl + '/AutoComplete.asmx/SearchCustomer', data: "{ 'searchTxt': '" + request.term + "' }", dataType: "json", dataFilter: function (data) { return data; }, success: function (data) { response($.map(data.d, function (item) { return { value: item } })) }, error: function (response) { alert(response.responseText); }, failure: function (response) { alert(response.responseText); } }); }, select: function (e, i) { var v = i.item.value.split('-')[0]; $('#txtAccountNum').val(v); }, minLength: 1 }); });
 <html lang="en"> <head runat="server"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="Dashboard"> <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina"> <title>Details</title> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script> <script src="../../Scripts/AutoCompleteSearch.js"></script> </head> <body> <section id="iframe-content-full"> <section class="iframe-wrapper"> <form class="cmxform form-horizontal style-form" id="form" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="row"> <div class=" form"> <div class="col-lg-6 col-md-6 col-sm-6"> <div class="form-group "> <asp:Label id="lblAccount" runat="server" class="control-label col-lg-2">Customer No </asp:Label> <asp:TextBox ID="txtAccountNum" runat="server" ClientIDMode="Static" class=" col-lg-2" maxlength="50" Autocomplete="off"></asp:TextBox> <div class="col-lg-5"> <asp:TextBox ID="txtAccountName" runat="server" ClientIDMode="Static" Placeholder="Customer No" minlength="2" class="custSearch form-control" Autocomplete="off" ></asp:TextBox> </div> </div> </div> </div> </div> </form> </section> </section> </body> </html>

感谢戴先生提供建议。 问题是由于程序中使用的脚本 src 没有使用安全的 https。 将所有 src 链接更改为“https”后问题解决。

希望这对其他人也有帮助,以节省他们的时间。 我花了很长时间寻找这个问题的解决方案。

再次感谢戴。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM