CreateObject
asked on
VB.NET: Create a Dynamic Frame Tag based on QueryString Value
I have a main frame page (index.aspx) that loads a content frame.
If a value gets passed in on the query string to this index.aspx page, I want the content frame to load a different page.
Here's the code:
<SCRIPT language="VB" runat="server">
Dim ArticleID as Integer
Sub Page_Load(Source As Object, E As EventArgs)
If IsNothing(Request.QueryStr ing.GetVal ues("Artic leID")) then
ArticleID=0
Else
ArticleID=Request.QueryStr ing.GetVal ues("Artic leID")(0)
End If
End Sub
</SCRIPT>
<html>
<head>
<title></title>
</head>
<frameset rows="121,*" framespacing="0" border="0" frameborder="0">
<frame name="banner" scrolling="no" noresize target="contents" src="top_frame.aspx">
<frameset cols="227,*">
<frame name="contents" target="main" src="side_frame.aspx" scrolling="auto" noresize>
<!-- HERE IS THE TROUBLE SPOT -->
<frame name="main" src="main_frame.aspx" scrolling="auto">
<!-- this "main" frame should load "main_frame.aspx" if there is nothing
on the querystring (or rather, if ArticleID=0); but if ArticleID has a value,
it needs to load "myarticle.aspx" -- what is the syntax??? -->
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
If a value gets passed in on the query string to this index.aspx page, I want the content frame to load a different page.
Here's the code:
<SCRIPT language="VB" runat="server">
Dim ArticleID as Integer
Sub Page_Load(Source As Object, E As EventArgs)
If IsNothing(Request.QueryStr
ArticleID=0
Else
ArticleID=Request.QueryStr
End If
End Sub
</SCRIPT>
<html>
<head>
<title></title>
</head>
<frameset rows="121,*" framespacing="0" border="0" frameborder="0">
<frame name="banner" scrolling="no" noresize target="contents" src="top_frame.aspx">
<frameset cols="227,*">
<frame name="contents" target="main" src="side_frame.aspx" scrolling="auto" noresize>
<!-- HERE IS THE TROUBLE SPOT -->
<frame name="main" src="main_frame.aspx" scrolling="auto">
<!-- this "main" frame should load "main_frame.aspx" if there is nothing
on the querystring (or rather, if ArticleID=0); but if ArticleID has a value,
it needs to load "myarticle.aspx" -- what is the syntax??? -->
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ehm, that or wasn't meant to be an or, the or is actually what i do in my example