SmartNavigation and keeping pages on top

Joined
Feb 12, 2006
Messages
18
Location
Australia
Programming Experience
10+
I have a web application written in VS2003 (VB.NET) and use SmartNavigation to stop long data entry pages from scrolling on postback, i.e. if I refresh the page based on something a user selects, the page position is maintained.

When I pop up a report or help page in a new window, the new page stays in the background and I have to either Alt + TAB to display it or go to the task bar.

Is there a simple way to force the new page to open so it stays on top? Here's my ASP.NET code:

VB.NET:
    Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnHelp.Click
        Dim popupScript As String = "<script language='javascript'>" & _
            "window.open('Help_New_Product_Form.htm', 'CustomPopUp', " & _
            "'width=800, height=600, left=112, top=84, resizable=yes, scrollbars=yes');CustomPopUp.focus()" & _
            "</script>"

        Page.RegisterStartupScript("PopupScript", popupScript)
    End Sub
 
One more thing ...

If I remove the SmartNavigation tag from the Page directive, the new window opens on top but I then lose control of the page position on postback. I've been struggling with this forever:mad:
 
Option 1: upgrade to VS2005 and use the MaintainScrollPositionOnPostback directive. It works fine when tested here.
Option 2: if the only thing done in btnHelp's click event handler is to open the window, switch to an html control and use client side script only that requires no postback.
 
Thanks for the prompt response. Unfortunately the project is already late and over budget (my fault) so upgrading to VS2005 is not an option at this point. There are a number of other things that don't translate easily from VS2003 to VS2005 and I just have to get the project finished.

I'll try option 2 and see whether that works the way I need it to.
 
Back
Top