FRAMESET and QueryString

T

TR

Given the following frameset named MyFrameSet.htm:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head><TITLE>LaunchFrame</TITLE>
<FRAMESET ROWS="88%,12%">
<FRAME id='frame1' name='frame1' SRC="placeholder.htm" >
<FRAME id='frame2' name='frame2' SRC="Game.aspx">
</FRAMESET>
</head>
</html>

and given the fact that another page, Temp.htm, opens MyFrameSet.htm in
this way, setting a query string value:

<a href='MyFrameSet.htm?player=999'>Open the frameset</a>

Is it possible for *server-side* code in Game.aspx (loaded into frame2)
to obtain the query-string value for "player" (i.e. 999)?

Thanks for the help!
TR
 
J

Jacky Kwok

TR said:
Given the following frameset named MyFrameSet.htm:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head><TITLE>LaunchFrame</TITLE>
<FRAMESET ROWS="88%,12%">
<FRAME id='frame1' name='frame1' SRC="placeholder.htm" >
<FRAME id='frame2' name='frame2' SRC="Game.aspx">
</FRAMESET>
</head>
</html>

and given the fact that another page, Temp.htm, opens MyFrameSet.htm in
this way, setting a query string value:

<a href='MyFrameSet.htm?player=999'>Open the frameset</a>

Is it possible for *server-side* code in Game.aspx (loaded into frame2)
to obtain the query-string value for "player" (i.e. 999)?

Thanks for the help!
TR


You can do so by using "aspx" frameset file. However, most people think
it is not a good method.


"in webform.aspx.cs"
e.g.
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion

public string GetFrame1()
{
return "<frame name=\"top\" src=\"http://www.microsoft.com\" >";
}

public string GetFrame2()
{
string param=Request.Params["abcd"];
return "<frame name=\"top\"
src=\"http://msdn.microsoft.com?abcd="+param+"\" >";
}
}


"in webform.aspx"
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<frameset rows="*,*">
<%=GetFrame1()%>
<%=GetFrame2()%>
</frameset>
</html>
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top