Avatar of javierpdx
javierpdx
Flag 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!
.NET ProgrammingASP.NETC#

Avatar of undefined
Last Comment
javierpdx

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Easwaran Paramasivam

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
javierpdx

ASKER
Thanks.  That was helpful.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck