<asp:listbox> autopostback enforces other control validations on the form

A

Adrita

Hi,

I have a form which has an <asp:listbox> and a lot of other
<asp:textbox>s which have their own <asp:requiredfieldvalidators>.

The Listbox is the first control on the form. I want to show a certain
hidden field when a particular value is selected in the listbox. This
is done by setting the autopostback value of the listbox to True and
handling the SelectedIndexChanged of the listbox. This happens fine,
but since this enforces a postback, all the form required field
validators are fired too and i see a list of error messages in the
<asp:validationsummary> control (Netscape) because i have not yet got
to filling up the rest of the values on the form.

Is there a way that I can do an autopostback from a listbox and choose
NOT to fire the validations on the page? Only the Button's Postback
should fire the validations. The problem is that, unlike the
"CausesValidation" property of an <asp:button> (which can be set to
false, if required) there is no such property for the <asp:listbox>.


Thanks,
Adrita
 

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,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top