How to change src in a frameset frame based on ListBox selection

Hi,

This is my first attempt at using Web Forms (my previous experience has only been with Windows forms and this seems to be Worlds different) and I am having a tough time figuring out how to do the following:

I have a Frameset that has a header, footer, contents and main section.  When the .htm form is loaded a listBox is populated and displayed in frame Contents, and the frame Main displays a generic .aspx form (that has an image on it).  

What I would like to be able to do is when the user makes a selection from the ListBox, that a different form gets loaded into the Frame Main - replace the wfSplash.aspx with wfViewer.aspx.

Can someone give me some idea on how to do this?  I am using VB.Net, and have had little/no experience with VB script or Java script - not sure if it's needed here, most of what I'm trying to do is very new to me.

Snippet from the frmMain.htm page when loaded:

       <frameset rows="67,78%,32">
            <frame name="header" src="wfHeader.aspx" noResize scrolling="no">
            <frameset cols="143,77%">
                  <frame name="contents" src="wfReportList.aspx">
                  <frame name="main" src="wfSplash.aspx" noResize scrolling="no">
            </frameset>
            <frame name="footer" src="wfFooter.aspx" noResize scrolling="no">

I need to change
<frame name="main" src="wfSplash.aspx" noResize scrolling="no">
to
<frame name="main" src="wfViewer.aspx" noResize scrolling="no">
if the user makes a selection in the frame Contents (wfReportList.aspx), ListBox

Hope this makes sense.... Help?

Thanks,
Jan
LVL 7
janmariniAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

davidlars99Commented:
ok, if you say you have a listbox than it must look something like this right..?

<select name="somename">
      <option value="value1">Value 1</option>
      <option value="value2">Value 2</option>
      <option value="value3">Value 3</option>
</select>

add "onchange" event to it like so...

<select name="somename" onchange="top.main.location.href='wfViewer.aspx'">
      <option value="value1">Value 1</option>
      <option value="value2">Value 2</option>
      <option value="value3">Value 3</option>
</select>

0
janmariniAuthor Commented:
I'm answering my own question....Uses a javascript in the code behind on the form that has the List Box control to change the (src) .aspx in the parent frame

Private Sub lbReportList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbReportList.SelectedIndexChanged
        Dim strReport As String = lbReportList.SelectedItem.Value
        Select Case strReport
            Case "IS Call Details"
                Dim ScriptStr As String = "<Script language='javascript'>window.parent.document.frames(2).location.href='wfCriteria.aspx';</script>"
                Page.RegisterStartupScript("MyScript", ScriptStr)
            Case "IS Metrics"
                Dim ScriptStr As String = "<Script language='javascript'>window.parent.document.frames(2).location.href='wfViewer.aspx';</script>"
                Page.RegisterStartupScript("MyScript", ScriptStr)
        End Select
0
davidlars99Commented:
so what did I do than..?
0
moduloCommented:
Closed, 500 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

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.