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

Posted on 2006-04-12
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
      End If

End Sub



<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>
              <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??? -->

  <p>This page uses frames, but your browser doesn't support them.</p>



Question by:CreateObject
    LVL 4

    Accepted Solution

    for me this works:

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

    or, use standard asp between html code
    LVL 4

    Expert Comment

    ehm, that or wasn't meant to be an or, the or is actually what i do in my example

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now