Redirecting a Frameset main page from the server side.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Would appreciate any solutions people could offer for this.

Basically I wan't to use a frameset with an aspx page as the contents
rather than a htm page and I'd like to be able to redirect the main page from
the code behind the contents page.

I want to do this to allow the use of asp "linkbuttons" instead of
hyperlinks so I can do a little processing before redirecting. The main
reason for this to prevent hyperlinks of pages that have been visited going
purple and instead just highlight the current page. (kinda petty I know but I
might be needing to do some more processing before redirecting in other areas
later in development so would be good to know now).

Is there a way to do this?

Thanks in anticipation.
 
I'd think that there is no way to achieve what you want directly from .aspx
code, however you could do a little Javascript workaround by writting
directly onto the response stream a
<script>window.top.location="<wherever-you-want-to-go-today>";</script> ...
and thus redirecting on the client side, only now your target frame is
"top" - the main browser window :]

It's been a while since I'd written any Javascript, so the actual code above
might not be 100% accurate, but the whole idea has been tried out with
success many times in the past :D

hope this helps a bit,

Angel
O:]
 
hi....

this should work for you...
in the click even for the link button just stream the javascript to the
response output.

Response.Write("<script>window.open('login.aspx','_top');<script>");

Regds
Kannan.V
 
Back
Top