??
Usually in ASP.NET you don't cross post to different pages like in the classic ASP days. With ASP.NET the form POSTS to itself by default. So you don't need a re-direct unless you need to go to a different aspx page or resource. In fact re-directing to the same page is a very bad thing to do because it will cause a double request to the server for the same page !
browser -> requests samepage.aspx (POST)
server -> processes POST, hits the re-direct and sends browser a re-direct message
browser -> requests samepage.aspx (GET)
server -> supplies page
Instead of
browser -> requests samepage.aspx (POST)
server -> processes POST, supplies page.
Your error suggests to me you have misspelled the page name, or the page is in a sub/parent path.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
You can disable viewstate for the page so the controls don't keep their values between postbacks.
or
After having saved to the database
Just itertate the controls and set their property .Text = String.Empty; in the code.
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
hiii,,,,well u can clear the textboxes on the click of the save button
like::::: TextBox1.text="";
if the insert query is properly fired thn u can use the above code..for e.g.
_______________
private void Button1_Click(object sender, System.EventArgs e)
{
create a connection///
try{
sql command ins = new sql command("insert statement......")
if (ins.ExecuteNonQuery()>0)
{
textbox1.text="";
}
else{......}
}
catch{......}
}
__________________________________
try it ,,,hope it wil wrk for u :)
johnny.g
Junior Poster in Training
91 posts since Feb 2008
Reputation Points: 10
Solved Threads: 3