Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Dynamically adding ASP.NET validator

Back to Forum: Tech Off
  • User profile image
    JParrish

    I needed to be able to configure validators so I created a simple XML schema and add the validators at run time. Everything is working well, but there is one side affect that I am not sure how to fix.

    In my scenario I have a multi-view control, with a validation summary above it. I have image buttons as tabs, and when a tab is clicked to switch views, the validator fires but the page still changes to the new tab. So the result is the summary contains the error message from the first view, but is now on a different view. I am not sure what I missed when adding it dynamically that prevents it from trapping the post back and changing the view?

    Any help is appreciate.

  • User profile image
    jwignall

    I've not had a look at this so apologies if my response is worthless but two things I'd do is to ensure that each view has a seperate validation group and also check that Page.IsValid is true before setting the active view.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.