0
  1. I have an aspx page inside of which I have an user control and inside that I have a grid view. ASPX -> ASCX -> GridView (the gridview has controls dropdownlist, textbox , checkbox)
  2. The controls in the gridview are enabled or disabled based on the checkbox on the aspx page. If the checkbox on the aspx is checked then the bunch of columns are enabled.
  3. To save these changes to database there is a button on aspx page which saves the data.

Validation:
When the save button is pressed I need to validate the grid view. The validation is little tricky there is drop down list textbox and checkbox in each of the row.
(dropdown -REQUIRED && textbox - REQUIRED) OR Checkbox is Checked.

I wanted to know what are the best possible options to validate this, I tried javascript but they do not want to do client side validation. If I use custom validation with validation group that should do it?

4

1 回答 1

0

Use User Input Validators, which will cause validation to fire when you click the Save button (assuming you set CausesValidation on the button to true). You can even use a ValidationSummary control to display all of your errors in a concise list format.

Validation is very easy with ASP.NET, just google around for "ASP.NET validation" and you'll get a lot of material.

于 2012-05-23T20:30:15.597 回答