Solved

JavaScript - Open a new window with parameters

Posted on 2003-12-04
1
537 Views
Last Modified: 2008-02-26
I have to open a new window from my ASP.net web application.

Here is the code I've been using.

Dim strScript As String = "<script language='javascript'>" & vbCrLf
strScript += " function window.onload() {" & vbCrLf
strScript += "    window.open('POREP01.aspx'); }" & vbCrLf
strScript += "</script>" & vbCrLf

Me.RegisterClientScriptBlock("strScript", strScript)

This works fine. But now I hwve to do the same thing on another page with parameters...and I am not able to place the parameters in Javascript, being new to JavaScript. Here is an example of a page which I have to open in a new window.

OrderpreviewPO.aspx?ordernumber=" & Me.ddlOrderNumber.SelectedItem.Value


0
Comment
Question by:Priya25
1 Comment
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 75 total points
ID: 9873211
Priya25,
Try this :

        Dim ParentLoadScript As String
        Dim strURL As String

        If IsPostBack Then
            strURL = "POREP01.aspx?ordernumber=" + Me.ddlOrderNumber.SelectedValue.ToString
            ParentLoadScript = "<script language=javascript>"
            ParentLoadScript &= "window.open('" + strURL + "');"
            ParentLoadScript &= "</" & "script>"
        End If

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

Regards
x_com
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need help on C# Linq query on object 6 64
I need help making a collection from a class in VB.Net 3 33
Alert on Server memory 2 24
parsing JSON help 1 10
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question