pass parameters while opening a new window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dddd81
    New Member
    • Apr 2010
    • 2

    pass parameters while opening a new window

    Hey
    I'm quite new in developing and I'm having some problems with passing url parameters.
    I'm writing in vb.net (asp.net) and usually when creating an event, I'm using this:

    dim paramName as string
    paramName = request.queryst ring("CODE")... .

    ...btn_onclick ()...
    response.redire ct("1.aspx?code =" & paramName)

    The problem is that now I need to do the same, but open the new page in a new window.
    I understand that I need to use window.open() and write some javascript
    (I thought at first that I need target="_blank" )
    Since I'm not that familiar with javascript I don't really understand how to pass a parameter from the previous page to the new one

    Thanks,
    D.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Code:
    window.open("1.aspx?code=" + paramName, "windowName");
    this will open a new window or tab (depending on the browser settings).

    Comment

    • dddd81
      New Member
      • Apr 2010
      • 2

      #3
      Thanx, I tried using this in the code behind file but it response an error, as if im trying to use something wrong

      Do you think I need to import some namespace?(impo rt system. ...)

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        that is JavaScript code to be executed in the browser. if VB or ASP can do something with that, I don’t know.

        Comment

        Working...