Link to home
Start Free TrialLog in
Avatar of javierpdx
javierpdxFlag for United States of America

asked on

!IsPostack submitting data to SQL with .net c# application

Hello,
I'm trying to understand !IsPostback.
Should I be using if(!IsPostBack) after a button click before submitting data to a SQL database like the following?
 protected void btn101_Click(object sender, EventArgs e)
{     
       if (!IsPostBack)
            {
           //insert into statement
            }
}

Open in new window

Could this help prevent duplicate data entries which I have seen occasionally?

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of javierpdx

ASKER

Thanks.  That was helpful.