Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing a form after POST in Asp.net

Whats the normal procedure of clearing a form after POST? Just loop through the textboxes and cleat all text? I have an ASP.NET application with several forms and I am trying to avoid them sending the data twice?

Thanks

like image 750
Saif Khan Avatar asked Jan 25 '23 00:01

Saif Khan


1 Answers

You can avoid double sending/doing by putting your code inside an if(!isPostBack) block. This will tell the page not to do the specified actions when posting.

like image 144
ZCHudson Avatar answered Feb 03 '23 16:02

ZCHudson