谁能帮我?
我有问题。当更改 Telerik 的 radcombobox 时,验证文本框句柄。但我希望仅在单击时进行验证处理button1
。
以下代码:
网
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadComboBox1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
<telerik:AjaxUpdatedControl ControlID="Label1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<asp:Panel ID="Panel1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<telerik:RadComboBox ID="RadComboBox1" AutoPostBack="true" runat="server" DataSourceID="SqlDataSource1" DataTextField="cg_id" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"></telerik:RadComboBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TravelConnectionString %>" SelectCommand="SELECT * FROM [Categorys_Group]"></asp:SqlDataSource>
</asp:Panel>
<telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
<asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" runat="server" Display="Dynamic"
ControlToValidate="RadTextBox1" ErrorMessage="Không được để trống!" ForeColor="Red"></asp:RequiredFieldValidator>
后面的代码:
protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
Label1.Text = RadComboBox1.SelectedIndex.ToString();
}
现在,我想在更改 RadComboBox1 验证时,TextBoxRequiredFieldValidator
不要处理。它仅在单击按钮时处理。
我该怎么办?谢谢帮帮我!