open window/add to javascript attributes

D

DC Gringo

Using vb.net, I have a button control:

<asp:Button OnClick="communitiesPrintReport()" id="btnPrintCommunities"
runat="server" Text="Button"></asp:Button>

Private Sub btnPrintCommunities_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnPrintCommunities.Click

End Sub



That calls a JavaScript function:

function communitiesPrintReport() {
window.open('commPrintNew.aspx','communitiesPrint','scrollbars=yes,resizable=yes,height=600,width=800,menubar=yes,toolbar=yes');
}


But I want the page that's opening to receive a session variable
session("country") for processing. How can I have this session variable
maintained or added to the page as a URL paramater such as
commPrintNew.aspx?countryID=<session("countryID")

____
DC G
 
K

Ken Tucker [MVP]

Hi,

Another option

<asp:Button id="btnPrintCommunities" runat="server"
Text="Button"></asp:Button>

Private Sub btnPrintCommunities_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnPrintCommunities.Click

Dim strCommand As String

strCommand =
String.Format("window.open('webform2.aspx?Country={0}','communitiesPrint',"
& _

"'scrollbars=yes,resizable=yes,height=600,width=800,menubar=yes," &
_

"toolbar = yes ');", Session("Country").ToString)

RegisterClientScriptBlock("communitiesPrintReport", "<script
language=""JavaScript"">" & strCommand &
"</script>")


End Sub

Ken
-------------------
Using vb.net, I have a button control:

<asp:Button OnClick="communitiesPrintReport()" id="btnPrintCommunities"
runat="server" Text="Button"></asp:Button>

Private Sub btnPrintCommunities_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnPrintCommunities.Click
Session("Country") = "Your value"

End Sub



That calls a JavaScript function:

function communitiesPrintReport() {
window.open('commPrintNew.aspx','communitiesPrint','scrollbars=yes,resizable=yes,height=600,width=800,menubar=yes,toolbar=yes');
}


But I want the page that's opening to receive a session variable
session("country") for processing. How can I have this session variable
maintained or added to the page as a URL paramater such as
commPrintNew.aspx?countryID=<session("countryID")

____
DC G
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top