方案
我正在开展一个webform项目。我创建了一个网页,其中我在更新面板中放置了一个下拉列表和一个gridview。当Dropdown事件OnSelectedIndexChanged
提升gridview数据源绑定但同时在chrome控制台窗口中发生错误时。
以下是我的Aspx代码:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="panel-body">
<div class="row">
<div class="col-md-4">
<div class="input-group ah-equal-textbox-size">
<span class="input-group-addon">Select Role</span>
<asp:DropDownList
ID="ddlSelectRole"
runat="server"
CssClass="form-control chosen-select"
AutoPostBack="true"
OnSelectedIndexChanged="ddlSelectRole_SelectedIndexChanged"
>
<asp:ListItem Selected="True" Value="0">Select Role</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4 ah-top-bottom-margin9px">
</div>
</div>
<hr />
<asp:GridView
ID="gvRoleRights"
runat="server"
ShowHeaderWhenEmpty="true"
AutoGenerateColumns="false"
EmptyDataText="No Data Found!"
ShowFooter="False"
BorderStyle="None"
CellPadding="3"
GridLines="Horizontal"
SkinID="AHGridView">
<Columns>
<asp:BoundField DataField="Role_ID" HeaderText="Role ID" />
<asp:BoundField DataField="Form_Name" HeaderText="Form Name" />
<asp:BoundField DataField="Can_View" HeaderText="Can View" />
<asp:BoundField DataField="Can_Edit" HeaderText="Can Edit" />
<asp:BoundField DataField="Can_Prepare_By" HeaderText="Can Prepare" />
<asp:BoundField DataField="Can_Change_Status_By" HeaderText="Active" />
<asp:BoundField DataField="Prepared_By_ID" HeaderText="Prepared By ID" />
<asp:BoundField DataField="Prepared_Date" HeaderText="Prepared By Date" />
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
以下是我的主页Scriptmanager代码:
<asp:ContentPlaceHolder ID="ScriptContentPlaceHolder" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" CombineScripts="true">
<Scripts>
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="bootstrap" />
<asp:ScriptReference Name="respond" />
<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>
</ajaxToolkit:ToolkitScriptManager>
</asp:ContentPlaceHolder>
我已经搜索了很多但没有找到任何参考如何解决以下错误。我还附上了一些我在互联网上搜索过的参考链接。如果你们有任何想法如何解决以下错误,请告诉我。
答案 0 :(得分:1)
我的猜测是你不需要其中一个:
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
尝试一次删除一个,看看错误是否消失。