p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   using javaScript in the code behind (http://p2p.wrox.com/showthread.php?t=41035)

@shish April 10th, 2006 06:57 AM

using javaScript in the code behind
 
hi...
  please could any one tell how to open a popup using javascript in the code behind of an asp.net application..... and also pass some parameters in the url ie.
window.open("xyz.aspx?a="+value1+"&b="+value2,"",f eatures) ..this is
fine in the client side code but how can i use it in the code behind.. thank you

achhetri

billmaher April 10th, 2006 03:19 PM

I was workin on a similar kind of issue some time ago, I used Page.RegisterStartupScript method.
I had to produce a pop up window with a chart and related data based on several listbox selections on the click of a button. Following is a VB.NET code that I wrote to achieve what I just explained. Hope this is what you are looking for.

Quote:

quote:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim strPop As String
        Dim file As String
        file = "chartmaker.aspx?chType=" & lst_ChType.SelectedValue & "&Table=" & lst_Table.SelectedValue & "&Values=" & lst_Values.SelectedValue & "&Categories=" & _
                lst_Categories.SelectedValue & "&Series=" & lst_Series.SelectedValue

        strPop = "<script language='javascript'>" & vbCrLf _
                & "window.open('" & file & "','Report','menubar=1,status=1,scrollbars=1,resiz able=1')" & vbCrLf _
                & "</script>" & vbCrLf
        Page.RegisterStartupScript("Pop", strPop)

    End Sub
Regards,
Sai Puli




All times are GMT -4. The time now is 01:25 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.