TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Johnathan Simpson
NA
5
712
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]
Reply
Answers (
2
)
unable to paste into text field by using keyboard short cut
SaaS Application