Asp.net 带有数据绑定下拉列表的gridview按钮失败
我有一个带有按钮的gridview,当单击该按钮时,它会触发一个rowcommand过程,并向数据库中添加一个新行。在我将数据绑定下拉列表添加到gridview之前,一切正常 使用数据绑定下拉列表,页面加载正常,但当我单击按钮时,错误显示为Internet Explorer无法显示网页。这是我的密码Asp.net 带有数据绑定下拉列表的gridview按钮失败,asp.net,vb.net,gridview,Asp.net,Vb.net,Gridview,我有一个带有按钮的gridview,当单击该按钮时,它会触发一个rowcommand过程,并向数据库中添加一个新行。在我将数据绑定下拉列表添加到gridview之前,一切正常 使用数据绑定下拉列表,页面加载正常,但当我单击按钮时,错误显示为Internet Explorer无法显示网页。这是我的密码 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridVi
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"
DataSourceID="SqlDataSource1">
<Columns>
<asp:ButtonField CommandName="insertNew"
Text="Button" />
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnAdd" runat="server" CommandName="insertNew"
CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
Text="Add" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField></asp:TemplateField>
</Columns>
</asp:GridView>
问题出在MsgBox行中。web应用程序中不支持MsgBoxindex
请删除MsgBoxindex,问题将得到解决,因为该功能仅在Windows应用程序中受支持。我刚刚将其放入system.web.config文件中
<httpRuntime maxRequestLength="32768" />
我刚刚在我的本地主机上安装了它,它在那里工作。在网格中有一个数据绑定下拉列表失败时,过程中的内容没有任何区别。顺便说一句,您可以在本地使用msgbox。
<httpRuntime maxRequestLength="32768" />