Groups | Blog | Home
all groups > asp.net datagrid control > october 2004 >

asp.net datagrid control : validation controls



Ian Oldbury
10/5/2004 1:43:02 PM
I've a datagrid with a textbox with autopostback=True and also validation
controls.
Even if the validation controls fail the postback still occurs.
How can i stop this happening?

ian

Jared
10/9/2004 8:37:58 AM
You can test for page validity in the form load event .

If Not Page.IsValid Then
' only executed when the page has been validated.
End If

You cannot assume the user has client side script enabled, that's why
validation control run at both client side and server side (also so a savvy
users cannot post nonvalidated input to the server), just make sure the page
is valid before you perform your processing.

HTH,
Jared

[quoted text, click to view]

Jared
10/9/2004 8:47:51 AM
Sorry, this should exclude the not in the test
If Page.IsValid Then
...
End If

[quoted text, click to view]

AddThis Social Bookmark Button