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



Who is Participating?
Joachim CarreinSr. Software DeveloperCommented:
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
Joachim CarreinSr. Software DeveloperCommented:
ehm, that or wasn't meant to be an or, the or is actually what i do in my example
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.