Hi all,
I wonder if there is a possibility to do the following:
Have a textbox and a customvalidator.
Use serverside validation for both, client- and servervalidation
with the clientvalidation through an async server call.
I want to have one validation function on the server for both checks.
I want for example check the entered vale in the textbox against a sql database.
Thanks, Tobi
I wonder if there is a possibility to do the following:
Have a textbox and a customvalidator.
Use serverside validation for both, client- and servervalidation
with the clientvalidation through an async server call.
I want to have one validation function on the server for both checks.
I want for example check the entered vale in the textbox against a sql database.
Thanks, Tobi
3 Answers, 1 is accepted
0
Hello Tobias,
You can find attached a sample demo project demonstrating RadTextBox client and server side validation using CustomValidator control. The error message will be displayed if the value of the RadTextBox has changed and the Validate button is clicked.
I hope this helps.
Regards,
Martin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You can find attached a sample demo project demonstrating RadTextBox client and server side validation using CustomValidator control. The error message will be displayed if the value of the RadTextBox has changed and the Validate button is clicked.
I hope this helps.
Regards,
Martin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Tobias
Top achievements
Rank 1
answered on 16 Oct 2009, 02:35 PM
Thanks for your example. So far I know these things.
In the "ClientValidation.aspx" of your sample.zip you give the following lines:
In the "ClientValidation.aspx" of your sample.zip you give the following lines:
<asp:ScriptManager runat="server" ID="ScriptManager1"> |
</asp:ScriptManager> |
<script type="text/javascript"> |
var invalidInput; |
function ValueChanged(sender, args) |
{ |
invalidInput = true; |
} |
function CustomValidate(sender, args) |
{ |
if (invalidInput) |
args.IsValid = false; |
invalidInput = false; |
} |
</script> |
<telerik:RadTextBox ID="RadTextBox1" runat="server" > |
<ClientEvents OnValueChanged="ValueChanged" /> |
</telerik:RadTextBox> |
<asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="CustomValidate" |
ErrorMessage="Invalid" Display="Dynamic" /> |
<asp:Button ID="Button1" runat="server" Text="Validate" /> |
In "function CustomValidate(sender, args)" I want to do an ajax check on the server e.g.
if (CheckIfUsernameIsInDataBaseServerSideAjaxCheck == true) {
...
} ...
I've already tried the use of Webservice or the ServerSideValidationExtender of "Validation Guidance Bundle" but I'd like to know your prefered methode to do such things because I didn't succeed with both mentioned doings.
Regards, Tobi
0
Hello Tobias,
For WebService validation (client and server side) you should use a RadInputManager. For more details please check the attached sample project. You can also check the following online demo:
Regards,
Martin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
For WebService validation (client and server side) you should use a RadInputManager. For more details please check the attached sample project. You can also check the following online demo:
Validation through a web service
I hope this helps.Regards,
Martin
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.