?
Solved

VB.NET: Create a Dynamic Frame Tag based on QueryString Value

Posted on 2006-04-12
2
Medium Priority
?
957 Views
Last Modified: 2010-05-18
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.QueryString.GetValues("ArticleID")) then
            ArticleID=0
      Else
            ArticleID=Request.QueryString.GetValues("ArticleID")(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>

0
Comment
Question by:CreateObject
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
Joachim Carrein earned 1000 total points
ID: 16437206
for me this works:

<%if request("test") is nothing then%>
    <frame name="main" src="noscript.htm" scrolling="auto">
<%else%>
    <frame name="main" src="error.htm" scrolling="auto">
<%end if%>

or, use standard asp between html code
0
 
LVL 4

Expert Comment

by:Joachim Carrein
ID: 16437241
ehm, that or wasn't meant to be an or, the or is actually what i do in my example
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question