我已经为这个问题尝试了几乎所有可用的互联网解决方案,但没有一个解决了。请查看下面的代码,让我知道是否有人可以帮我解决问题。整页刷新正在发生每次单击单选按钮列表。
telerik:在master.master页面中定义的RadScriptManager
Master.Master.Page中的用户控制在下面给出
<style type="text/css">
.rlbItem
{
float:left !important;
}
.RadListBox_Default .rlbGroup
{
border: none !important;
}
</style>
<fieldset>
<asp:Panel runat="server" ID="uxMainPanel">
<asp:Label runat="server" Text="" Visible="false" id="uxCategoryId"></asp:Label>
<asp:Label runat="server" Text="" Visible="false" id="uxProjectId"></asp:Label>
<asp:Label runat="server" Text="" Visible="false" id="uxTemplateId"></asp:Label>
<asp:Label runat="server" Text="" Visible="false" id="uxPublicationId"></asp:Label>
<asp:CheckBox ID="uxViewType" Visible="false" runat="server" />
<table style="width:100%"><tr><td>
<asp:Repeater ID="uxQuestionsList" ClientIDMode="AutoID" runat="server">
<HeaderTemplate></HeaderTemplate>
<ItemTemplate>
<table class="white-table">
<tr>
<td style="text-align:right" class="tdLabel">
<asp:Label ID="uxQuestionId" runat="server" Text='<%# Eval("ProposalScreeningCategoryQuestionId")%>' Visible="false" />
<asp:Label ID="uxTemplateQuestionId" runat="server" Text='<%# Eval("ProposalScreeningTemplateCategoryQuestionId")%>' Visible="false" />
<asp:Label ID="uxQuestionText" runat="server" Text='<%# Eval("ProposalScreeningCategoryQuestionName")%>' />:
<asp:Label ID="uxQuestionAnswerId" runat="server" Text="" Visible="false" />
<asp:Label ID="uxCollaborativeInstituteId" runat="server" Text='<%# Bind("institute_id")%>' Visible="false" />
</td><td class="tdField">
<asp:UpdatePanel runat="server" ID="up1s">
<ContentTemplate>
<div id="dvi">
<asp:RadioButtonList ClientIDMode="AutoID" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="uxAnswerFlag_SelectedIndexChanged" ID="uxAnswerFlag" runat="server">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList>
<asp:Panel ID="uxAnswerFlagReasonCheckBoxPanel" runat="server">
<telerik:RadListBox RenderMode="Lightweight" DataTextField="ProposalScreeningCategoryQuestionReasonName" DataValueField="ProposalScreeningCategoryQuestionReasonId" ID="uxAnswerFlagReasonCheckBox" runat="server" CheckBoxes="true" width="100%"
/>
</asp:Panel>
<asp:Panel ID="uxAnswerFlagReasonRadioButtonListPanel" Visible="false" runat="server">
<asp:RadioButtonList RepeatDirection="Horizontal" DataTextField="ProposalScreeningCategoryQuestionReasonName" DataValueField="ProposalScreeningCategoryQuestionReasonId" ID="uxAnswerFlagReasonRadioButtonList" runat="server" />
<br /><asp:Label ID="uxError" Visible="false" ForeColor="Red" Font-Bold="true" Text="Please choose an answer from above list" runat="server"></asp:Label>
</asp:Panel>
<appcontrols:AppRequiredFieldValidator ID="AppRequiredFieldValidator1" ValidationGroup="save" runat="server" ControlToValidate="uxAnswerFlag" />
</div> </ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="uxAnswerFlag" EventName="SelectedIndexChanged" /></Triggers></asp:UpdatePanel> </td>
</tr>
<tr><td style="text-align:right" class="tdLabel">Comments: <br /> <span class="gray">(Maximum 1500 characters)</span></td>
<td class="tdField" >
<Telerik:RadTextBox ID="uxAnswerText" runat="server" Width="98%" Rows="8" onkeyup="if (this.value.length > 1500) { alert('Character limit has been reached!'); this.value = this.value.substr(0,1500); }" TextMode="MultiLine" />
<asp:Label ID="uxAnswerLabel" Visible="false" runat="server" Width="98%" />
<br />
</td>
</tr>
<asp:Panel ID="uxActionByPanel" runat="server" Visible="false">
<tr><td style="text-align:right" class="tdLabel">Action By:</td><td class="tdField"><asp:Label ID="uxActionBy" Visible="false" runat="server" Width="98%" /></td></tr>
</asp:Panel>
</table>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
</td></tr><tr><td align="center">
<asp:Button Text="Save" id="uxSave" CommandName="CallFromNestedUserControl" ValidationGroup="save" CssClass="ButtonNormal" runat="server" />
<asp:Button Text="Edit" id="uxEdit" CausesValidation="false" CssClass="ButtonNormal" runat="server" />
</td></tr>
</table>
</asp:Panel>
<asp:Panel runat="server" ID="uxSecondPanel">
<p><b>There are no any Questions to be answered for this section.</b></p>
</asp:Panel>
<asp:HiddenField ID="uxSingleOutcomeCategoryHiddenField" Value="0" runat="server" />
</fieldset>
答案 0 :(得分:0)
删除 up1s的Triggers
集合。更新面板位于数据绑定控件中,因此单选按钮列表的最终ID将针对每一行进行更改,它永远不会完全是uxAnswerFlag。
您也可以尝试将ChildrenAsTriggers
属性设置为true
。
通常,在数据绑定控件中使用MS AJAX有点难以实现这种粒度,因此您可以查看支持AJAX的整个转发器。