controlling redirection within frames

H

headware

I have a question about how best to implement a redirection to a
framed version of a web site. Basically I have a web site that was
originally implemented without frames. Then it was decided that it
needed frame, so I made a page called index.aspx that contained the
frameset that initially displayed the original home page, home.aspx,
in one of the frames.

However that meant that the user had to go to
http://some_stuff/index.aspx instead of http://some_stuff/home.aspx
which was bad for various reasons (mostly because people are used to
home.aspx being the home page).

So we decided to make the home.aspx page redirect immediately to the
index.aspx page like this:

private void Page_Load(object sender, System.EventArgs e)
{
Response.Redirect("/some_stuff/index.aspx");
}

However, this resulted in infinite redirections. So to stop it from
redirecting to the home.aspx page after the first time, I decided to
do something like this:

private void Page_Load(object sender, System.EventArgs e)
{
if(Session["beenHome"] == null)
{
Session["beenHome"] = "dummy";
Response.Redirect("/some_stuff/index.aspx");
}
}

This works pretty well for the most part except that if after getting
to the home page (with the frames displaying correctly), the user
manually retypes the url to be http://some_stuff/home.aspx they will
get the page without the frames.

I understand why things work the way they do, but I'm just wondering
if there's a better way to do this (i.e. one without the flaw I
mentioned).

Thanks,
Dave
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top