Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > open window/add to javascript attributes

Reply
Thread Tools

open window/add to javascript attributes

 
 
DC Gringo
Guest
Posts: n/a
 
      06-07-2005
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


 
Reply With Quote
 
 
 
 
Tod Birdsall
Guest
Posts: n/a
 
      06-07-2005
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

 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      06-07-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data attributes override method attributes? Jayden Python 16 09-29-2012 03:20 AM
attributes ala java annotations or .Net attributes? Kyle Schmitt Ruby 3 07-24-2007 07:48 PM
class attributes & data attributes james_027 Python 2 06-20-2007 03:12 PM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM



Advertisments