Avoid Invalid Postback

Sep 1 2015 10:20 PM
I keep getting an invalid postback error, I know why, but how do I avoid and fix it?  This is my syntaxx and anytime the Save button is pressed this is thrown.  What do I do to fix it?  Most answers I see are add to if (!ispostback) but that is not applicable in my scenario.
[code]
 
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
Setup();
GetCustom();
PullData();
}
}
catch
{
}
}
private void GetCustom()
{
this.ddlInfo.DataSource = StoredProcedureToPullResults;
this.ddlInfo.DataTextField = "BindFIeld";
this.ddlInfo.DataValueField = "BindFIeld";
this.ddlInfo.DataBind();
}
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
foreach (ListItem item in this.chkList.Items)
{
if (item.Selected)
{
//SQL Insert STatement
}
}
}
catch { }
}
private void PullData()
{
try
{
this.dtgData.DataSource = StoredProcedure;
this.dtgData.DataBind();
}
catch {}
}
[/code] 

Answers (2)