open window/add to javascript attributes

Discussion in 'ASP .Net' started by DC Gringo, Jun 7, 2005.

  1. DC Gringo

    DC Gringo Guest

    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
     
    DC Gringo, Jun 7, 2005
    #1
    1. Advertising

  2. DC Gringo

    Tod Birdsall Guest

    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
     
    Tod Birdsall, Jun 7, 2005
    #2
    1. Advertising

  3. 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
    -------------------
    "DC Gringo" <> wrote in message
    news:...
    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
     
    Ken Tucker [MVP], Jun 7, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RJN
    Replies:
    1
    Views:
    8,751
    Patrik Löwendahl [C# MVP]
    Oct 10, 2004
  2. ml
    Replies:
    0
    Views:
    1,456
  3. ml
    Replies:
    2
    Views:
    4,860
    John C. Bollinger
    Nov 30, 2004
  4. P4trykx
    Replies:
    2
    Views:
    1,828
    bruce barker
    Jan 31, 2007
  5. PC HUA
    Replies:
    2
    Views:
    423
    PC HUA
    May 19, 2004
Loading...

Share This Page