473,407 Members | 2,359 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,407 software developers and data experts.

Response.redirect not working

In the code below, I am trying to go from one asp page to another:

For Each tripToAccept As String In tripsToAccept.Split("/"c)
dataManager.UpdateTripDetail("Accept", CInt(tripToAccept),
Hiduser.Value)
Next
Response.Redirect("TripAcceptReject.aspx", False)
I am not getting an error, but I'm also not seeing anything happen at
all. This is an existing app and it looks like the page I'm trying to
open up is a modal page, could that be an issue. Is there another way
to open up one asp page from another?

Jun 21 '07 #1
5 11160
On Jun 21, 8:55 am, Doug <dnlwh...@dtgnet.comwrote:
In the code below, I am trying to go from one asp page to another:

For Each tripToAccept As String In tripsToAccept.Split("/"c)
dataManager.UpdateTripDetail("Accept", CInt(tripToAccept),
Hiduser.Value)
Next

Response.Redirect("TripAcceptReject.aspx", False)

I am not getting an error, but I'm also not seeing anything happen at
all. This is an existing app and it looks like the page I'm trying to
open up is a modal page, could that be an issue. Is there another way
to open up one asp page from another?
Is the previous code getting excuted or is the redirect not working?
You can try Server.transfer(urllocation)

Jun 21 '07 #2
Doug wrote:
In the code below, I am trying to go from one asp page to another:

For Each tripToAccept As String In tripsToAccept.Split("/"c)
dataManager.UpdateTripDetail("Accept", CInt(tripToAccept),
Hiduser.Value)
Next
Response.Redirect("TripAcceptReject.aspx", False)
I am not getting an error, but I'm also not seeing anything happen at
all. This is an existing app and it looks like the page I'm trying to
open up is a modal page, could that be an issue. Is there another way
to open up one asp page from another?
As you are setting the second parameter to false, the execution
continues in the code. Obviously you are doing something else later on
in the code that prevents the redirection.

If you want the execution of the current code to end after the Redirect
statement, specify true as the second parameter, or use the overload
without a second parameter:

Response.Redirect("TripAcceptReject.aspx")

--
Göran Andersson
_____
http://www.guffa.com
Jun 22 '07 #3
As you are setting the second parameter to false, the execution
continues in the code. Obviously you are doing something else later on
in the code that prevents the redirection.
I'm not doing anything later on. There's no more code after this.
It should go directly to the TripAcceptReject page, but it doesn't.
>
If you want the execution of the current code to end after the Redirect
statement, specify true as the second parameter, or use the overload
without a second parameter:
I tried that, but I kept getting a threading error. Per a previous
post, someone told me to use false for that parameter to avoid the
error and then this is what happens.

I did try using Server.Transfer and that appears to work but after it
executes the code in the redirected page, it jumps back to the calling
page, throws that Threading exception, but still displays the
TripAcceptReject page, but within the same window. I want it to
display as a seperate window (I believe it currently is doing this as
a modal window, but the way it was called before is through
Javascript, I'm now in server side code (VB) and need to do it there.
I can't believe that it is that hard to do a simple redirect to a
window!!!! :))

Jun 23 '07 #4
Doug wrote:
>As you are setting the second parameter to false, the execution
continues in the code. Obviously you are doing something else later on
in the code that prevents the redirection.

I'm not doing anything later on. There's no more code after this.
It should go directly to the TripAcceptReject page, but it doesn't.
There doesn't have to be any code that you have written after that to
interfer with the process. The page creation process continues,
rendering the controls that you have in the page into an html page that
is sent to the browser.

If you don't want that to happen, you have to make sure that there are
no controls in the page so that the rendering doesn't produce any
output. Then it might work.
>If you want the execution of the current code to end after the Redirect
statement, specify true as the second parameter, or use the overload
without a second parameter:

I tried that, but I kept getting a threading error. Per a previous
post, someone told me to use false for that parameter to avoid the
error and then this is what happens.
The Response.Redirect method uses an exception to end the execution of
the current page. This is normal, and if you want it to work normally,
you should not catch this exception.

Using the second parameter does prevent the exception to be thrown, but
if you want to do it that way, you have to deal with the rest of the
page creation process.
I did try using Server.Transfer and that appears to work but after it
executes the code in the redirected page, it jumps back to the calling
page, throws that Threading exception, but still displays the
TripAcceptReject page, but within the same window.
It's not jumping back to the page. It's rendering the page because the
first page added it's controls to the page tree, and the second page
also added it's controls to the page tree, and is rendering all of it
into a single html page.
I want it to
display as a seperate window (I believe it currently is doing this as
a modal window, but the way it was called before is through
Javascript, I'm now in server side code (VB) and need to do it there.
I can't believe that it is that hard to do a simple redirect to a
window!!!! :))
If you want to display it as a separate window, you can't use server
code to accomplish it. A new window can only be opened from the browser,
so you have to either use a link with target="_blank" or the window.open
method in Javascript.

--
Göran Andersson
_____
http://www.guffa.com
Jun 24 '07 #5
If you want to display it as a separate window, you can't use server
code to accomplish it. A new window can only be opened from the browser,
so you have to either use a link with target="_blank" or the window.open
method in Javascript.
I am not sure how to go from being in server code to calling
Javascript code. Do you have some suggestions for where to look to
learn how to do this?

Jun 24 '07 #6

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

Similar topics

3
by: Bill | last post by:
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect contains the page within "pagename.asp", I have...
3
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
5
by: john | last post by:
Hello, One our thrid page for some reason the response.redirect isn't working on the live server. It works fine on the development machine but when we move the code to the live server it doesn't...
1
by: Sospeter | last post by:
Hi Ken, I have done that but still experiencing same problem. Tried the following i.e. turning smartnavigation = false and using server.transfer as below but nothing works. Please help. ...
10
by: Niggy | last post by:
I get an error - any help appreciated. System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object...
14
by: gaurav tyagi | last post by:
in my appplication if i try to go to next page using response.redirect, it does not work and control remains on same page but if i use server.transfer control goes to nex page?? can any one...
3
by: Marc Hoeijmans | last post by:
Hello, I have a problem with the Response.Redirect. The redirect is working for some users for other useres it is not working. We all use the same browser. I have coded the Response.Redirect after...
5
by: ODAN | last post by:
We are testing a ASP.NET application in Visual Studion 2003 and written in C#. One of the pages that register new users on this application fails to redirect to another page when the button is...
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....
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.