how to redirect to a frames-based html page and load the right html when coming from an ASP.NET page

  • Thread starter Thread starter Mark Kamoski
  • Start date Start date
M

Mark Kamoski

Hi--

I need a code sample of how to redirect from an ASP.NET page to a
frames-based html page and specifying what should load in the destination's
frames.

Any ideas?

(Even air-code is much appreciated.)

The long story is this. I have 2 sites. One is in DotNet and one is html
and frames. The DotNet site is a section by section rewrite of the html and
frames site. So the html site has 2 frames, one is the left nav and the
other is content. So, from the html site, I can simply point to a new
section that is in DotNet and the user goes to the DotNet site for that
section. Then, when in the DotNet site, if the user wants to go to a
section has NOT yet been rewritten in DotNet, then the DotNet nav needs to
send the user back to the html site and load the left nav and the correct
content. And so on.

If you can help, please post a code snippet.

Thank you very much.

--Mark
 
Here is one untested idea ...

IF your HTML site can support ASP, ASP.NET, Perl, Java,
etc, you could create one new page that is a frameset
wrapper, which will generate the frameset HTML based on
QueryString or FormVars. You could then pass those vars
to that page and have it generate the frameset that would
specify the locations. Here is a very crude ASP example:

<frameset cols="100,*">
<frame src="Nav.htm" />
<frame src="<%=Request("ContentURL")%>" />
</frameset>

(As always, validate input for things like cross-site
scripting.)

hth,
Frank
 
Write the follwoing code in your code behind page. Change the outputstr as you need.

Dim outputstr As String
outputstr = "<html>" _
& vbCrLf & "<head>" _
& vbCrLf & "<title>Forms from code behind</title>" _
& vbCrLf & "</head>" _
& vbCrLf & "<frameset rows='108,*,22'>" _
& vbCrLf & "<frame name='Title' src='http://www.hotmail.com'>" _
& vbCrLf & "<frame name='body' src='http://www.hotmail.com'>" _
& vbCrLf & "<frame name='footer'src='http://www.hotmail.com'>" _
& vbCrLf & "</frameset>" _
& vbCrLf & "</html>"
Response.Write(outputstr)

In your ASPX page remove all the html content, and retain only the page directive.

Hope this helps you.

Ram
 
Back
Top