473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Response.Redirect Posts back?

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.
Nov 18 '05 #1
2 1860
Have you tried setting database connection to nothing before the redirect?

"Sam Miller" <Sa*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
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.

Nov 18 '05 #2
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
"Sam Miller" <Sa*******@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
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.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
3
by: michael_vanommeren | last post by:
I have two web applications that I am working with and I am trying to do a Response.Redirect from one to the other. They are setup as separate web applications on the same IIS server. If I go...
1
by: MikeM | last post by:
We are getting a behavior on a Response.Redirect("SomeUrl", True) that I'm hoping someone can explain. This all refers to the code snip at the end. By the way, this is all VB ASP.NET v1.0 code. ...
4
by: batista | last post by:
Hello All, I want to know the Difference Between Server.Transfer() And Response.Redirect()?
0
by: Clas | last post by:
Hello! I have written a javascript which posts back a page with __doPostBack if a user presses the escape-button on the keyboard. Then in Page_Load I´m doing a response.redirect to another page....
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: nkoier | last post by:
Hi, I've been going crazy trying to figure out what's wrong with our Asp.Net 2.0 intranet site. At the very top of our main page I provide a TextBox and a Button for submitting Google searches....
11
by: Paul Furman | last post by:
I'm setting up credit card payment through authorize.net and they have the option to send a POST string back to my site once complete. I'm not sure how to proceed. They don't have much to read...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.