This is a migrated thread and some comments may be shown as answers.

server side validation

1 Answer 137 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 04 Oct 2018, 10:04 PM
I'm using the radWizard and on one step, the users enter a bank routing number and an account number.  I have a database table that holds all the valid routing numbers and I would like to validate that what the user entered in a radtextbox is an actual value in the table.  Is there a way to call server-side validation before I navigate to the next step in the wizard?

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 09 Oct 2018, 10:24 AM
Hello Weasel,

You can set the Current step as Active in the NextButtonClick and NavigationBarButtonClick events: 

protected void RadWizard1_NavigationBarButtonClick(object sender, WizardEventArgs e)
{
    var wizard = (sender as RadWizard);
    var isCustomValid = CustomServerValidation();
    if (!isCustomValid)
    {
        // prevent step change
        e.CurrentStep.Active = true;
    }
}
 
private bool CustomServerValidation()
{
    // custom validation
    return false;
}
 
protected void RadWizard1_NextButtonClick(object sender, WizardEventArgs e)
{
    var wizard = (sender as RadWizard);
    var isCustomValid = CustomServerValidation();
    if (!isCustomValid)
    {
        // prevent step change
        e.CurrentStep.Active = true;
    }
}


Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Wizard
Asked by
Bruce
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or