473,327 Members | 1,979 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,327 software developers and data experts.

Server.Transfer Refreshing Browser Problem

I have two pages in my project.

Page 1 has a command button that when it is clicked inserts a record
in a database and does a server.transfer to Page2.

The problem is, if I do a refresh when the browser gets to Page2, it
re-runs the insert code on Page1 resulting in two records being
inserted. I guess the whole point of Server.Transfer is that it all
happens server side.

I like using Server.Transfer, because I don't have to have query
strings and session variables obviously span the whole project. Is
there any way to stop this behaviour?
Nov 18 '05 #1
1 1085
"Ian Walsh" <sp*******@tiscali.co.uk> wrote in message
news:90**************************@posting.google.c om...
I have two pages in my project.

Page 1 has a command button that when it is clicked inserts a record
in a database and does a server.transfer to Page2.

The problem is, if I do a refresh when the browser gets to Page2, it
re-runs the insert code on Page1 resulting in two records being
inserted. I guess the whole point of Server.Transfer is that it all
happens server side.

I like using Server.Transfer, because I don't have to have query
strings and session variables obviously span the whole project. Is
there any way to stop this behaviour?


Not really. Your browser still thinks it is at the old page, and is hitting
up the old page with a new request. F5 IE refreshes are very dangerous in
this context. The one nice thing about Response.Redirect() is that, despite
the round tripping, there is no risk of this sort of thing happening.

R.
Nov 18 '05 #2

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

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
4
by: Harsh Thakur | last post by:
Hi, I'd like to know the performance related differences between Response.Redirect and Server.Transfer. I'd like to redirect the user to a different page. I can either do a...
4
by: john | last post by:
I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a...
1
by: Craig Banks | last post by:
I have 2 ASP.Net solutions/projects. I want to use Server.Transfer in one solution/project to call the aspx webform in the second solution/project. When I try it I get an error message. My call is...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
5
by: Richard | last post by:
I've developed a small ASPX template framework (based on Chun Li's article on CodeProject: http://www.codeproject.com/aspnet/headerfooter.asp#xx849313xx) which uses a IHttpModule to apply...
2
by: archana | last post by:
Hi all, I am new to asp.net. I am trying to use server.transfer and respnse.redirect. When i nagivate to page using server.transfer on navigated page if i click on refresh i am getting...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: 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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.