Multiview and field validation

M

M. Ali Qureshi

Hi,

Another question from a newbie....

Scenario:
- I have a multiview on page "MultiView1". This contains 2 views inside it
(ViewList and ViewInsert).
- ViewList shows data in a grid control.
- ViewInsert have a few textfields with validation controls attached. These
fields will insert data in the table.
- There are 2 buttons (placed outside the multiview) which should toggle
between 2 views (Button1 and Button2)
- PageLoad sets the ActiveView to "ViewList"

Problem:
When i click on button2, it toggles the view and shows ViewInsert
When i click button1, which should toggle again to show ViewList, the field
validators give error that the required fields are not filled.
I understand that this is working as it should as the button posts back the
page.
My question is that how can i toggle between views without validating the
fields?

Thanks for help.

/MAQ
 
P

Phil H

Hi,

Another question from a newbie....

Scenario:
- I have a multiview on page "MultiView1". This contains 2 views inside it
(ViewList and ViewInsert).
- ViewList shows data in a grid control.
- ViewInsert have a few textfields with validation controls attached. These
fields will insert data in the table.
- There are 2 buttons (placed outside the multiview) which should toggle
between 2 views (Button1 and Button2)
- PageLoad sets the ActiveView to "ViewList"

Problem:
When i click on button2, it toggles the view and shows ViewInsert
When i click button1, which should toggle again to show ViewList, the field
validators give error that the required fields are not filled.
I understand that this is working as it should as the button posts back the
page.
My question is that how can i toggle between views without validating the
fields?

Thanks for help.

/MAQ

The answer is you can't have it both ways - sorry!

Actually it's not too bad. It just means you can't use client-side
validation. You'll have to do it on the server using your own code.
Normally it's done to improve performance by avoiding round trips. If,
however, client-side validation is paramaount then you'll have to
present the user with a view that does not allow any other course of
action until they enter valid data or exit via a cancel option.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top