open window/add to javascript attributes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DC Gringo

    #1

    open window/add to javascript attributes

    Using vb.net, I have a button control:

    <asp:Button OnClick="commun itiesPrintRepor t()" id="btnPrintCom munities"
    runat="server" Text="Button"></asp:Button>

    Private Sub btnPrintCommuni ties_Click(ByVa l sender As System.Object, ByVal e
    As System.EventArg s) Handles btnPrintCommuni ties.Click

    End Sub



    That calls a JavaScript function:

    function communitiesPrin tReport() {
    window.open('co mmPrintNew.aspx ','communitiesP rint','scrollba rs=yes,resizabl e=yes,height=60 0,width=800,men ubar=yes,toolba r=yes');
    }


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

    ____
    DC G


  • Tod Birdsall

    #2
    Re: open window/add to javascript attributes

    Hi DC G,

    I think what you are looking for is the following:

    commPrintNew.as px?=<%= Session("countr yID") %>

    Hope this helps.

    Tod Birdsall, MCSD for .Net
    Blogger ist ein Veröffentlichungs-Tool von Google, mit dem du ganz einfach deine Gedanken der Welt mitteilen kannst. Mit Blogger kannst du problemlos Texte, Fotos und Videos in deinem persönlichen Blog oder deinem Team-Blog veröffentlichen.


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

    Comment

    • Ken Tucker [MVP]

      #3
      Re: open window/add to javascript attributes

      Hi,

      Another option

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

      Private Sub btnPrintCommuni ties_Click(ByVa l sender As System.Object, ByVal e
      As System.EventArg s) Handles btnPrintCommuni ties.Click

      Dim strCommand As String

      strCommand =
      String.Format(" window.open('we bform2.aspx?Cou ntry={0}','comm unitiesPrint',"
      & _

      "'scrollbars=ye s,resizable=yes ,height=600,wid th=800,menubar= yes," &
      _

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

      RegisterClientS criptBlock("com munitiesPrintRe port", "<script
      language=""Java Script"">" & strCommand &
      "</script>")


      End Sub

      Ken
      -------------------
      "DC Gringo" <dcgringo@visio ntechnology.net > wrote in message
      news:eQ1qaDxaFH A.724@TK2MSFTNG P12.phx.gbl...
      Using vb.net, I have a button control:

      <asp:Button OnClick="commun itiesPrintRepor t()" id="btnPrintCom munities"
      runat="server" Text="Button"></asp:Button>

      Private Sub btnPrintCommuni ties_Click(ByVa l sender As System.Object, ByVal e
      As System.EventArg s) Handles btnPrintCommuni ties.Click
      Session("Countr y") = "Your value"

      End Sub



      That calls a JavaScript function:

      function communitiesPrin tReport() {
      window.open('co mmPrintNew.aspx ','communitiesP rint','scrollba rs=yes,resizabl e=yes,height=60 0,width=800,men ubar=yes,toolba r=yes');
      }


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

      ____
      DC G



      Comment

      Working...