I have a GridView whose columns names are ID, Name, Price, Tolerance, Remarks and Value_f.
I have TextBoxes in the Template Field for Price, Tolerance and Remarks. I have one Button called “Save Button” below the Gridview.
I bind the values for ID, Name and Value_f from the Backend datatable.
Now the problem is,
I have to validate the textboxes in the Gridview when I press the Save Button. Suppose if the Value_f field from the DataTable has value '1', then I should not validate the TextBoxes in the GridView. How to Validate based on these conditions?
For the normal validation, I placed RequiredFieldValidator for the TextBoxes and Sets the TextBox property ValidationGroup = "Grid" and I assign the same to the “Save Button”. But in this case, I dont know how to validate the controls in the Client side?
You can create a custom JS function and call JS function on
Button OnClientClick event.For example:
Calling Function