By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

open window/add to javascript attributes

P: n/a
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=80 0,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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi DC G,

I think what you are looking for is the following:

commPrintNew.aspx?=<%= Session("countryID") %>

Hope this helps.

Tod Birdsall, MCSD for .Net
http://tod1d.blogspot.com

Help me get free Sony PSP and get one for yourself:
http://tinyurl.com/8n4hg

Nov 21 '05 #2

P: n/a
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=80 0,menubar=yes," &
_

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

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

Ken
-------------------
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:eQ*************@TK2MSFTNGP12.phx.gbl...
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=80 0,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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.