Results 1 to 5 of 5

Thread: Open a page in a new window

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Open a page in a new window

    How do you open a page in a new window? It seems like it should be easy but I don't know how to do it, unless its from a link.

    During the SelectedIndexChange event of a dropdownlist I'd like to open a related page in a new window, but can't figure out how to do it.

    I basically want this to open in a new window instead of the one it is called from:
    VB Code:
    1. Response.Redirect(fpath)

  2. #2
    Hyperactive Member jeba's Avatar
    Join Date
    Feb 2000
    Posts
    265
    Hi,
    Instead of Response.Redirect use this
    Code:
    <% ' your asp code here
    'Response.Redirect(page.aspx) 'Dont use this
    %>
    <script>
    window.open("page.aspx");
    </script>
    <% Response.End %>
    J£ßä

  3. #3

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    But how would I fire that from a button press or inside a SelectedIndexChanged event?

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Location
    Chicago
    Posts
    30

    client side

    You couldnt - unless you input that script into the innerhtml of a <span runat=server > Tag - if you go this route you have to put the span at the bottom of the page and change the inner html in the SelectedIndexChanged event

    OR

    you could just go ahend and use cleint script all the way -
    using the onclick event or onchange event of a HTML control (or select or input tag>

    something like this
    Ex.

    <head>
    <sciript Language=javascript>

    function RunMe
    {

    window.open(window.myform.myfield.value)
    }
    </script>

    </head>


    <input id=myfield onclick=Javascript:runme>

  5. #5
    Lively Member
    Join Date
    Jul 2002
    Location
    Gateshead, UK
    Posts
    101

    Very true

    In a nutshell there - I would tend to just stick with client javascript, when doing that.
    <% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width