Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame Resets widths on Refresh

Status
Not open for further replies.

tqeonline

MIS
Oct 5, 2009
304
US
I have an index.html that creates a frameset

Code:
    <frameset name="menu" border="1" frameborder="1" framespacing="0" cols="180px,*">
        <frame name="Navigation" src="[URL unfurl="true"]http://sqadashboard.int.asurion.com/edit/Menu.aspx"/>[/URL]
        <frame name="Display" src="[URL unfurl="true"]http://sqadashboard.int.asurion.com/edit/Home.aspx"/>[/URL]   
    </frameset>

On the navigation frame I have it load "Menu.aspx" and on the menu page I have code that will resize the frame to 50px from the original 180px

Code:
        If btnMenuSize.ToolTip = "Expand Menu" Then
            LoginStatus.Visible = True
            CreateUser.Visible = True
            TreeView.Visible = True
            chkLoop.Visible = True
            With btnMenuSize
                .ImageUrl = "[URL unfurl="true"]http://sqadashboard.int.asurion.com/edit/Images/shrink.jpg"[/URL]
                .ToolTip = "Shrink Menu"
                .Attributes.Clear()
                .Attributes.Add("onclick", "javascript:parent.resizeFrames('50px,*');")
            End With
        ElseIf btnMenuSize.ToolTip = "Shrink Menu" Then
            LoginStatus.Visible = False
            CreateUser.Visible = False
            TreeView.Visible = False
            chkLoop.Visible = False
            With btnMenuSize
                .ImageUrl = "[URL unfurl="true"]http://sqadashboard.int.asurion.com/edit/Images/expand.jpg"[/URL]
                .ToolTip = "Expand Menu"
                .Attributes.Clear()
                .Attributes.Add("onclick", "javascript:parent.resizeFrames('180px,*');")
            End With
        End If

The issue is this. When I have the navigation shrunk to 50px, and i hit F5 the parent resets the frames to 180x,* when it should be 50px,*.

Is there anyway I can catch the frame sizes right before refresh and reset them after refresh?



- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
We probably need to see the HTML actually generated and displayed to determine whether this is an HTML problem or not. If you feel it may be an ASP issue then try posting in the ASP.NET forum instead.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
There are several ways you could do this... I think the easiest for would be to save the current width in a cookie, and use that to set the width when the page is loaded.

Hope this helps,

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
I ended up figuring out something that would work. I put the code in the page load to read the button and set the width. So on postback it sets the right width to the pages.

Code:
        If Page.IsPostBack Then
            If btnMenuSize.ToolTip = "Shrink Menu" Then
                Response.Write("<script>" & vbCrLf)
                Response.Write("parent.resizeFrames('50px,*');")
                Response.Write(vbCrLf & "</script>")
            Else
                Response.Write("<script>" & vbCrLf)
                Response.Write("parent.resizeFrames('180px,*');")
                Response.Write(vbCrLf & "</script>")
            End If
        End If

- Matt

"If I must boast, I will boast of the things that show my weakness"

- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top