Multiview and field validation

  • Thread starter Thread starter M. Ali Qureshi
  • Start date Start date
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
 
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.
 
Back
Top