help with insert record please
in a typical insert new record web page coded using asp.net...
If user click "refresh" button in the web browser too bar, then it automatically insert a new record.
I don't like this, How can I only add new record when user click insert button on my web form?
thanks
Re: help with insert record please
Quote:
Originally Posted by redshirtme
in a typical insert new record web page coded using asp.net...
If user click "refresh" button in the web browser too bar, then it automatically insert a new record.
I don't like this, How can I only add new record when user click insert button on my web form?
thanks
Check for the IsPostBack property in the Page_Load event
Re: help with insert record please
I found the solution through asp.net forums.
response.redirect to the same page will do the trick!
Re: help with insert record please
Quote:
Originally Posted by redshirtme
I found the solution through asp.net forums.
response.redirect to the same page will do the trick!
Yep that should do it too, but best practice and safe thing to do is only add rows if there has been a PostBack.
Glad you found the solution.
Good luck, happy coding.. :wave: