Results 1 to 10 of 10

Thread: Redirect to URL in a new window?

Hybrid View

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Redirect to URL in a new window?

    In VB.NET code in an ASP.NET project, I can call:
    VB Code:
    1. Response.Redirect("NewPage.apsx")
    And this directs me to "NewPage.aspx" in my current browser window. But how can I open this URL in a new window rather than the current one?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: Redirect to URL in a new window?

    You can only open a new window client-side, so send a javascript inline command via the buffer.
    Last edited by GlenW; Apr 19th, 2005 at 10:31 AM. Reason: Bad spelling

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Redirect to URL in a new window?

    That's ridiculous!?!

    My form is serverside, therefore all my controls are serverside. You mean I can't possibly open in a new window then?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  4. #4
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: Redirect to URL in a new window?

    Sorry that's the way it is, but sending inline javascript only takes a couple of lines of code.

  5. #5

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: Redirect to URL in a new window?

    Quote Originally Posted by GlenW
    Sorry that's the way it is, but sending inline javascript only takes a couple of lines of code.
    Can I do that from a webcontrol button that is run at the server?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  6. #6
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: Redirect to URL in a new window?

    Yes just send the javascript via Response.Flush after putting the script in the Buffer.
    Make sure you pad the buffer first 'cos it won't flush if its contents are too small and your script will be too small.

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