Response.Redirect error

A

Adam Beer

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
 
I

IPGrunt

(e-mail address removed) (Adam Beer) confessed in
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
 
B

bruce barker

you need it prepend a protocol header, so the browser does not think its a
relative path.

-- bruce (sqlwork.com)


| 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
 
A

Adam Beer

bruce barker said:
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
 
I

IPGrunt

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);


--
 

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

Top