|
-
June 27th, 2007, 01:34 PM
#1
Validation in user controls
I have a page with three user controls. The first control dynamically populates itself with link buttons, depending on the result of a database querry, in this case, ("Save", Cancel").
The second control reads values out of a database table and displays the values as text in an htmltable control.
The third control dynamically populates an html table with text, textboxes and dropdownlists. None of the dropdown lists have a value selected. Under certain conditions it places a RequiredFieldValidator control next to one of the dropdownlists.
When the entire page populates itself and loads in the browser, the validator control text is displayed in red, even before any user input has occured.
When the "Save" button the code checks "Page.IsValid", but it returns true, even if no selection is made.
I want the error message to remain hidden until I click "Save". If no selection is made in the dropdownlist box, I want the error to be visible, and the event handler for the link button to know about it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|