Groups | Blog | Home
all groups > asp.net webcontrols > october 2003 >

asp.net webcontrols : launching asp page in frame in frameset based on toolbar


stephencmyers NO[at]SPAM hotmail.com
10/31/2003 11:58:40 PM
Ok, learning .net and working with a frameset. The "Top" frame is
basically a toolbar using the microsoft webcontrols. I want to load
the "Bottom" frame based on the button selected on the top frame.

I can retrieve the button info in this vbscript sub:

Private Sub Toolbar1_ButtonClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Toolbar1.ButtonClick


myvar = sender.Text

If myvar = "a" launch page1.asp in "bottom"
If myvar = "b" launch page2.asp in "bottom"

End Sub


lukezhan NO[at]SPAM online.microsoft.com
11/3/2003 7:40:23 AM
Hi Steve,

To change a frame from another, we need to use some client script, you may
refer to this article as a sample:

HOWTO: Refresh a Specific Frame from Script
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q194227

In your case, you may use following script to change web page in a frame:

window.parent.frames(1).location ="webform2.aspx"

However, since above are client script, you can't execute it in code behind
of a ASP.NET control. I suggest you can add them to client side with
Page.RegisterClientScriptBlock Method. For more information, you may refer
to:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp

Hope this help,


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


AddThis Social Bookmark Button