Jump to content

Multi-Page Forms


DooVoo

Recommended Posts

I'm currently writing a multi-page form that makes use of the .NET validation web components. However, once I add an onClick event to the submit button (to control the multi-page state) it breaks the validation. According to my reading the onClick event should cause a postback event which I thought would cause the validation to run. Is this not the case? If not, is there a way to solve this neatly?Any help would be lovely! :)

Link to comment
Share on other sites

Post Code? Ah yes, I might have wanted to do that! Heh, sorry!I've managed to solve the issue, for people having the same problem in the future you can check is a page is valid manually.So, imagine you have a button that calls the function "button_click" you will have a function like so:

protected void button_click(Object Source, EventArgs E){    if (Page.IsValid)    {        // Your Code Here    }}

This will cause your code to only be executed so long as the web controls pass any validation controls you have set.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...