Frame Redirect in C#
Posted
by Simon Linder
on Stack Overflow
See other posts from Stack Overflow
or by Simon Linder
Published on 2010-03-23T08:47:11Z
Indexed on
2010/03/23
8:53 UTC
Read the original article
Hit count: 387
I would like to execute a frame redirect in C# from my managed module for the IIS 7.
When I call context.Response.Redirect(@"http://www.myRedirect.org");
the correct page is shown but also the address is shown in the browser. And that is exactly what I do not want.
So I want something like:
private void OnBeginRequest(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
HttpContext context = app.Context;
// make a frame redirect if a specified page is called
if (context.Request.ServerVariable["HTTP_REFERER"].Equals(@"http://www.myPage.org/1.html"))
{
// perform the frame redirect here, but how?
// so something like
context.Response.Redirect(@"http://www.myRedirect.org");
// but as I said that doesn't redirect as I want it to be
}
}
Any ideas about that?
© Stack Overflow or respective owner