UpdatePanel控件与Repeater中子控件使用有关问题
UpdatePanel控件与Repeater中子控件使用问题
我在UpdatePanel中放了一个Repeater
在Repeater中放了一个RadioButton
代码如下:
实现RadioButton控件ra1_CheckedChanged事件局部刷新。
运行时报错:未能为 UpdatePanel“UpdatePanel2”中的触发器找到 ID 为“ra1”的控件
请问为什么ra1无法找到?
------解决方案--------------------
为Null你就单步跟踪下,我没写你的代码,所以也看不出来哪儿错了。确实,网上也找不到任何这样的资料,我能力也是有限,只能说。。。。最好还是把触发控件写到Repeater外面
我在UpdatePanel中放了一个Repeater
在Repeater中放了一个RadioButton
代码如下:
<asp:ScriptManager ID="ScriptManager1" runat=server>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Repeater id="Repeater1" runat=server >
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div class="prd_price_block">
<div class="prd_price_tt font_color8"><%#Eval("smallTypeName") %><asp:Label ID="lbid" runat="server" Visible="false" Text='<%#Eval("id") %>'></asp:Label></div>
<div class="prd_price_txt">
<%#Eval("detail") %>
</div>
<div class="prd_price">¥<%#Eval("Price") %></div>
<div class="prd_style_choose">
<label for="radio2" class="prd_style_choose">
<asp:RadioButton ID="ra1" runat="server" OnCheckedChanged="ra1_CheckedChanged" AutoPostBack="true" />
选择</label>
</div>
</div>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ra1" />
</Triggers>
</asp:UpdatePanel>
实现RadioButton控件ra1_CheckedChanged事件局部刷新。
运行时报错:未能为 UpdatePanel“UpdatePanel2”中的触发器找到 ID 为“ra1”的控件
请问为什么ra1无法找到?
------解决方案--------------------
为Null你就单步跟踪下,我没写你的代码,所以也看不出来哪儿错了。确实,网上也找不到任何这样的资料,我能力也是有限,只能说。。。。最好还是把触发控件写到Repeater外面