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.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Blerta
  • 2,170
  • 5
  • 23
  • 34
  • If the field is emptied on postback, can you convert it to a ASP.Net control? That way they would retain their values. – David Sep 23 '09 at 15:56

1 Answers1

0

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.)

Mike C.
  • 4,917
  • 8
  • 34
  • 38