Link to home
Start Free TrialLog in
Avatar of Roolee
Roolee

asked on

PopUp Window onload

I want to open a small pop up window when the page first loads.  

I tried doing it as javascript on load on the html page, but the page does postback as I have radio buttons on it, and I don't want the pop up to load everytime the page loads - just the first load.

Does anyone have any ideas how I can do this?

Can I call a client side function from code behind pages?
ASKER CERTIFIED SOLUTION
Avatar of _TAD_
_TAD_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of _TAD_
_TAD_



The key in the code is that in the On_PageLoad function you need

if IsPostback = false then


or

If !IsPostback then


command
              Dim ParentLoadScript As String
               Dim strURL As String

                If not page.IsPostBack Then
                    strURL = "POREP01.aspx"
                    ParentLoadScript = "<script language=javascript>"
                    ParentLoadScript &= "window.open('" + strURL + "');"
                    ParentLoadScript &= "</" & "script>"
                End If

                If Not IsClientScriptBlockRegistered("ParentLoad") Then
                    RegisterClientScriptBlock("ParentLoad", ParentLoadScript)
                End If


The above should work..Just replace the "POREP01.aspx" with the name of your pop up page..
Regards,
Priya
Avatar of Bob Learned
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: _TAD_ {http:#9608158}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer