Opening Popup directly from ASP.NET

bizzydint

Well-known member
Joined
Apr 8, 2003
Messages
75
Is there a way to open up a popup window from the .net code?

ie is there a way of calling javascript directly from the code, without needing user interaction? Or is there a way without using javascript?

Bascially, the way I want it to work is:
- user presses a button
- a load of calculations take place on the server which might take a while
- then a popup displays results

So I cant have the new window opening on the button press, as there wont be enough time for the calculations to have been made.

Hope someone can help (has been driving me mad!)
Thanks
Van
 
Code:
        Dim sWindow As String = "mywindow"
        Dim jscript As String

                jscript = "<script language=JavaScript>mywindow = window.open(file.aspx," + sWindow + ",height=350,width=532,toolbars=no,resizable=no)</script>"

        RegisterClientScriptBlock("mywindow", jscript)

Hope this helps you
 
Thankyou *so* much!

Ive been trying to work it out forever but it proved impossible to search for the answer!

Youre a star ;-)
 
Im getting the following error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30648: String constants must end with a double quote.

Source Error:



Line 164: Dim jscript As String
Line 165:
Line 166: jscript = "<script language=JavaScript>mywindow = window.open(contra.aspx," + sWindow + ",height=350,width=532,toolbars=no,resizable=no)</script>"
Line 167:
Line 168: RegisterClientScriptBlock("mywindow", jscript)


what have I missed off the code?
 
I pretty much used it as you have and it worked.
The only difference is that i had to do:
Page.RegisterClientScriptBlock("mywindow", jscript)

BUt I dont think that would give *that* error.

And Im assuming you have declared
Dim sWindow As String = "mywindow"


Sorry I cant be more useful....
Are you sure its not a red herring and the error is elsewhere??

good luck ;-)
 
Back
Top