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

Response.Redirect error

I have a visual basic app that contains a IE browser control and I am
using C#.NET to create dynamic content to be displayed within the IE
control. The app parses the URL for commands, but I've run into a
problem.

In my C# code, I attempt:

Response.Redirect("COMMAND_LOAD");

This should send the command to the VB app, however I am finding that
the actual redirect goes to "http://localhost/path/COMMAND_LOAD"
instead of simply "COMMAND_LOAD".

Is there a way to force the redirect to abstain from prepending the
local path where my code is running?

Thanks,
Adam
Nov 19 '05 #1
4 2142
ad*********@gmail.com (Adam Beer) confessed in
news:24**************************@posting.google.c om:
I have a visual basic app that contains a IE browser control and I am
using C#.NET to create dynamic content to be displayed within the IE
control. The app parses the URL for commands, but I've run into a
problem.

In my C# code, I attempt:

Response.Redirect("COMMAND_LOAD");

This should send the command to the VB app, however I am finding that
the actual redirect goes to "http://localhost/path/COMMAND_LOAD"
instead of simply "COMMAND_LOAD".

Is there a way to force the redirect to abstain from prepending the
local path where my code is running?

Thanks,
Adam


Have you tried:

Response.Redirect("../COMMAND_LOAD")

(by the way, I believe this has an additional argument.)

-- ipgrunt

Nov 19 '05 #2
you need it prepend a protocol header, so the browser does not think its a
relative path.

-- bruce (sqlwork.com)
"Adam Beer" <ad*********@gmail.com> wrote in message
news:24**************************@posting.google.c om...
| I have a visual basic app that contains a IE browser control and I am
| using C#.NET to create dynamic content to be displayed within the IE
| control. The app parses the URL for commands, but I've run into a
| problem.
|
| In my C# code, I attempt:
|
| Response.Redirect("COMMAND_LOAD");
|
| This should send the command to the VB app, however I am finding that
| the actual redirect goes to "http://localhost/path/COMMAND_LOAD"
| instead of simply "COMMAND_LOAD".
|
| Is there a way to force the redirect to abstain from prepending the
| local path where my code is running?
|
| Thanks,
| Adam
Nov 19 '05 #3
"bruce barker" <no***********@safeco.com> wrote in message news:<O$**************@tk2msftngp13.phx.gbl>...
you need it prepend a protocol header, so the browser does not think its a
relative path.

-- bruce (sqlwork.com)


Perhaps I misunderstand, but when I attempt any combination of the
following statements, I am still being redirected with the relative
path. Am I on the right track?

Page.Response.AddHeader("Location","");
Page.Response.AddHeader("Content-Location","");
Page.Response.AddHeader("Host","");

Page.Response.AddHeader("Refresh", "0;URL="+strRedirect);

Thanks,
Adam
Nov 19 '05 #4
On 15 Feb 2005, ad*********@gmail.com (Adam Beer) postulated in
news:24*************************@posting.google.co m:
"bruce barker" <no***********@safeco.com> wrote in message news:<O

$h*************@tk2msftngp13.phx.gbl>...
you need it prepend a protocol header, so the browser does not think its a relative path.

-- bruce (sqlwork.com)


Perhaps I misunderstand, but when I attempt any combination of the
following statements, I am still being redirected with the relative
path. Am I on the right track?

Page.Response.AddHeader("Location","");
Page.Response.AddHeader("Content-Location","");
Page.Response.AddHeader("Host","");

Page.Response.AddHeader("Refresh", "0;URL="+strRedirect);

Thanks,
Adam

No, Try :

Response.Write ("http://www.microsoft.com", false);
--
Nov 19 '05 #5

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

Similar topics

2
by: D. Nii | last post by:
Hi there, I have a web application that recently got redesigned and now makes use of Response.Redirect . The "new" application is hosted on Win2000 and works for all kinds of clients using IE...
2
by: Kerri | last post by:
Hi, I have do some Redirects in my applitcaion. For example, when the use rhas logged in successfully I redirect them to a different page. In my Redirect all I was doing was a.. ...
8
by: Daniel | last post by:
Hello, I have an old asp page that was used to redirect users called redirect.asp: <code1> <% Option Explicit If Request.QueryString("url") <> "" Then Response.Redirect ...
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
2
by: Brian | last post by:
I'm trying to response.redirect to another page on a button click event and I get an error message stating that the thread was being aborted (if I trap for the error that is...) I've researched...
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. ...
2
by: Glen Wilkin via DotNetMonster.com | last post by:
Is there a way I can call Response.Redirect after I've done a Response.Flush? I send some html to load an animated gif that plays whilst my page loads, it has some extensive database calls to...
7
by: Joe Rigley | last post by:
Hi, I have a custom class with a public method. I want to perform a repose.redirect if an error occurs in the public method GetUserRoles. Unfortunately, Visual Studio 2003 is throwing an error...
1
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing...
12
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.