I have a button that when clicked produces a PDF report. However I have validation on the page so that if the required fields are left empty when the button is clicked a validation summary appears. This doesn't work though. When the buttons clicked if fields are left empty it just reloads the page, but no validation sumamry shows. When the data is entered and the buttons clicked it brings up the window asking if the document should be opened or saved.

When I run through debug mode with no data entered

 if (Page.IsValid)

shows as true each time even when it isn't.

Any ideas?

Recommended Answers

All 4 Replies

Check to make sure that you didnt set the property --> CausesValidation="False"

No it's set to true.

hmm...I'd recheck the validation controls to make sure that you have them validating the proper fields. I know that when I create multiple controls, I have a habit of copying and pasting them and sometimes forget to update the field that is being validated.

Silly mistake, forgot to include the button in the validation group.

Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.