views:

60

answers:

1

I am using Page.RegisterStartUpScript if the user types not acceptable data but i want to force at least some part of my aspx page if not the entire page to not postback. Does anybody has a clue how this can be achieved ?

I am using some form to submit data and i don't want those field to be emptied at page postback.

A: 

Short of not allowing the user to access the form if they don't have javascript enabled, I don't know of any way to prevent the user from posting back if they want to (even by accident). That's why you need to assume there will be a postback and that user data will need to be error-checked on the server even if you're writing client-side validation. (And you need to make sure the user-entered data doesn't go away on postback, unless you intend to make like hard for them if they submit inaccurate data... that's your call.)

Parvenu74