页面中使用了ajax,有多个地方使用了同一个控件的异步调用的方式(这种方法是可以使用的,程序没有什么错误,且在visual studio 2005 中是可以正常在设计页面中显示的),具体如下:
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbTaskType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cbTaskType_SelectedIndexChanged">
<asp:ListItem Text="全部" Value=""></asp:ListItem>
<asp:ListItem Text="工作任务" Value="0"></asp:ListItem>
<asp:ListItem Text="操作任务" Value="1"></asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>异步调用的地方
<asp:UpdatePanel runat="server" ID="updpjsbz" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbJSBM" runat="server" Width="120" Height="22" AutoPostBack="True"
OnSelectedIndexChanged="cbJSBM_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cbTaskType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpdpJSBM" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbJSBZ" runat="server" Width="130" Height="22">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cbJSBM" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="cbTaskType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
OnRowDataBound="gvList_RowDataBound" >
........在设计页面中总是出现"创建控件时出错 - gvList找到多个具有相同 ID“cbTaskType”的控件。FindControl 要求控件具有唯一的 ID。" 的错误!
望合位高手帮忙解决
<asp:UpdatePanel runat="server" ID="UpdatePanel1" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbTaskType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cbTaskType_SelectedIndexChanged">
<asp:ListItem Text="全部" Value=""></asp:ListItem>
<asp:ListItem Text="工作任务" Value="0"></asp:ListItem>
<asp:ListItem Text="操作任务" Value="1"></asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>异步调用的地方
<asp:UpdatePanel runat="server" ID="updpjsbz" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbJSBM" runat="server" Width="120" Height="22" AutoPostBack="True"
OnSelectedIndexChanged="cbJSBM_SelectedIndexChanged">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cbTaskType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpdpJSBM" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cbJSBZ" runat="server" Width="130" Height="22">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cbJSBM" EventName="SelectedIndexChanged" />
<asp:AsyncPostBackTrigger ControlID="cbTaskType" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
OnRowDataBound="gvList_RowDataBound" >
........在设计页面中总是出现"创建控件时出错 - gvList找到多个具有相同 ID“cbTaskType”的控件。FindControl 要求控件具有唯一的 ID。" 的错误!
望合位高手帮忙解决
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货