如何在asp.net中验证telrik控件tollkit的rad组合框 [英] how to validate rad combo box of telrik control tollkit in asp.net

查看:81
本文介绍了如何在asp.net中验证telrik控件tollkit的rad组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的页面上使用rad组合框控件并使用其中给出的向导来绑定它...

i尝试使用必需的字段验证器验证这一点,但它不起作用...

i也尝试通过设置initieal值= 0或该索引的文本值







但没有任何工作......

任何建议.. plss bros ...?







 <   telerik: RadComboBox     ID   =  CountryCombo    runat   =  server    CssClass   =  MyComboBox    DataSourceID   =   SqlDataSource1    DataTextField  < span class =code-keyword> =  Country_Name    DataValueField   =  CountryID    EmptyMessage   = 选择国家/地区  >  <   / telerik:RadComboBox  >  
< asp:SqlDataSource ID = SqlDataSource1 runat = < span class =code-keyword> server ConnectionString = 数据源= FTPL01 \ SQL2012;初始目录= ZricksDB;持久安全信息=真;用户ID = sa;密码= webuser ProviderName = System.Data.SqlClient SelectCommand = SELECT [CountryID],[Country_Name] FROM [Country_Master] > ; <跨度class =code-keyword>< / asp:SqlDataSource >
< asp:RequiredFieldValidator < span class =code-attribute> ID = RequiredFieldValidator6 runat = server ControlToValidate = CountryCombo InitialValue = 0 ErrorMessage = * > < / asp:RequiredFieldValidator >



解决方案

不要添加InitialValue。删除它将正常工作。

下面我添加了您可以尝试的代码 -



< telerik: radcombobox id =CountryComborunat =servercssclass =MyComboBoxdatasourceid =SqlDataSource1datatextfield =Country_Namedatavaluefield =CountryIDemptymessage =Select Country>< / telerik:radcombobox> 

< asp:sqldatasource id =SqlDataSource1runat =serverconnectionstring =Data Source = FTPL01\SQL2012; Initial Catalog = ZricksDB; Persist Security Info = True; User ID = sa; Password = webuserprovidername =System.Data.SqlClientselectcommand =SELECT [CountryID],[Country_Name] FROM [Country_Master]>< / asp:sqldatasource>

< asp:requiredfieldvalidator id =RequiredFieldValidator6runat =servercontroltovalidate =CountryComboerrormessage =*>< / asp:requiredfieldvalidator>


i am using rad combo box control on my page and i bind this by using wizard given in it ...
i trying to validate this using required field validator , but it not working ...
i tried also by setting initieal value =0 or text value of this index



but nothing is working ...
any suggestion .. plss bros... ?



<telerik:RadComboBox ID="CountryCombo" runat="server" CssClass="MyComboBox" DataSourceID="SqlDataSource1" DataTextField="Country_Name" DataValueField="CountryID" EmptyMessage="Select Country"></telerik:RadComboBox>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=FTPL01\SQL2012;Initial Catalog=ZricksDB;Persist Security Info=True;User ID=sa;Password=webuser" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [CountryID], [Country_Name] FROM [Country_Master]"></asp:SqlDataSource>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="CountryCombo" InitialValue="0" ErrorMessage="*"></asp:RequiredFieldValidator>


解决方案

Do not add InitialValue. Remove that it will work correctly.
Below i have added code you can try-

<telerik:radcombobox id="CountryCombo" runat="server" cssclass="MyComboBox" datasourceid="SqlDataSource1" datatextfield="Country_Name" datavaluefield="CountryID" emptymessage="Select Country"></telerik:radcombobox>

    <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="Data Source=FTPL01\SQL2012;Initial Catalog=ZricksDB;Persist Security Info=True;User ID=sa;Password=webuser" providername="System.Data.SqlClient" selectcommand="SELECT [CountryID], [Country_Name] FROM [Country_Master]"></asp:sqldatasource>

    <asp:requiredfieldvalidator id="RequiredFieldValidator6" runat="server" controltovalidate="CountryCombo" errormessage="*"></asp:requiredfieldvalidator>


这篇关于如何在asp.net中验证telrik控件tollkit的rad组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆