Response.Redirect Posts back?

G

Guest

I have a submit button. In the event handler for that button I connect to
database and write all the control values to the db. Then I have a
response.redirect after the Conn.Close to leave the application and just go
to another page.

No matter where I put this Response.Redirect, it causes a blank row to be
inserted into the database in addition to the intended row. Its like the
Response.Redirect causes a postback and all the controls are refreshed to
nothing and all blanks written into the database.

But you don't see any of this happen. It just goes too quickly and the
browser goes to the intended page. But there is always this extra row in the
db.

I tried taking it out of the Button handler and putting inside a If
Page.IsPostback under onload. Also tried putting it in a sub and calling the
sub after Conn.close in the button handler.

No Luck.
Any help would be greatly appreciated.
 
K

Kevin Marshall

If your using VB rem out the Response.Redirect and put in a
Response.Write("Event Fired")

If you see "Event Fired" on the screen more than once your click event is
firing more than once, I had this problem a lot when I started .NET but only
with VB sites, C# never had this problem.


--
Kevin Marshall
WebXeL.com Ltd
http://www.webxel.com

ASP.NET Dreamweaver Extensions
http://www.webxel-dw.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top