誰能幫助我?如何在asp.net驗證之前更新面板。使用telerik
我有問題。當更改telerik的radcombobox時,如此驗證文本框句柄。但是我想驗證只在點擊button1
時才能處理。
follown代碼:
asp.net
<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
沒有處理程序。它只在點擊按鈕時處理。
我該怎麼辦? 謝謝幫幫我!