open a new window without javascript and without hyperlink

Discussion in 'ASP .Net' started by Dan, Nov 23, 2004.

  1. Dan

    Dan Guest

    hello all,
    is there a way to open a new window without javascript and a href=_blank?
    i need to connect a button click with some lines of code and then, a new
    window shall get opened.
    but i didn't find a way to opüen a new window as result of a buttonm click.

    thanks for help,
    dan
    Dan, Nov 23, 2004
    #1
    1. Advertising

  2. Dan

    Matt Berther Guest

    Hello dan,

    You'll need to either use javascript, or an anchor tag with a target=_blank.

    Either: window.open('someURL') or <a href="someURL" target="_blank">

    You can not open a window from the server, as the server has no concept of
    a browser. The only thing you can do from the server is render code (as above)
    to do this on the client.

    --
    Matt Berther
    http://www.mattberther.com

    > hello all,
    > is there a way to open a new window without javascript and a
    > href=_blank?
    > i need to connect a button click with some lines of code and then, a
    > new
    > window shall get opened.
    > but i didn't find a way to opüen a new window as result of a buttonm
    > click.
    > thanks for help,
    > dan
    Matt Berther, Nov 23, 2004
    #2
    1. Advertising

  3. Dan

    Martin Eyles Guest

    "Dan" <-tuebingen.de> wrote:-
    > is there a way to open a new window without javascript and a href=_blank?
    > i need to connect a button click with some lines of code and then, a new
    > window shall get opened.
    > but i didn't find a way to opüen a new window as result of a buttonm

    click.

    you could make the button a submit button in a form, and have the target of
    the form set to _blank (see example below, and see
    http://www.w3.org/TR/html4/interact/forms.html for more on the syntax.), or
    you could 'fake' a button, by using and image of a button as a link.

    eg. 1
    <form action="http://somesite.com/somepage.html" method="post"
    target="_blank">
    <input type="submit" value="Send" />
    </form>

    eg. 2
    <a href="http://somesite.com/somepage.html" target="_blank">
    <img src="fakeButton.png" alt="I'm a Button, Honest" />
    </a>

    --
    Martin Eyles
    Martin Eyles, Nov 23, 2004
    #3
  4. Put a big block of text in your page that says "Open a new browser and go to
    the following URL in it: Your URL". If you're lucky, some of your users will
    do it. Otherwise, use a link, or JavaScript.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "Dan" <-tuebingen.de> wrote in message
    news:cnvogh$kgj$-tuebingen.de...
    > hello all,
    > is there a way to open a new window without javascript and a href=_blank?
    > i need to connect a button click with some lines of code and then, a new
    > window shall get opened.
    > but i didn't find a way to opüen a new window as result of a buttonm

    click.
    >
    > thanks for help,
    > dan
    Kevin Spencer, Nov 23, 2004
    #4
  5. I'm thinking that there must be some reason why you don't want to use
    JavaScript. Perhaps it's because you have some server-side processing to do,
    which necessitates a PostBack, and you don't hink you can open a new window
    once the page reloads. But you can. Just add the script using
    Page.RegisterStartupScript().

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "Dan" <-tuebingen.de> wrote in message
    news:cnvogh$kgj$-tuebingen.de...
    > hello all,
    > is there a way to open a new window without javascript and a href=_blank?
    > i need to connect a button click with some lines of code and then, a new
    > window shall get opened.
    > but i didn't find a way to opüen a new window as result of a buttonm

    click.
    >
    > thanks for help,
    > dan
    Kevin Spencer, Nov 23, 2004
    #5
  6. Dan

    bruce barker Guest

    popup blockers prevent this approach - so I'd avoid it.

    -- bruce (sqlwork.com)


    "Kevin Spencer" <> wrote in message
    news:...
    | I'm thinking that there must be some reason why you don't want to use
    | JavaScript. Perhaps it's because you have some server-side processing to
    do,
    | which necessitates a PostBack, and you don't hink you can open a new
    window
    | once the page reloads. But you can. Just add the script using
    | Page.RegisterStartupScript().
    |
    | --
    | HTH,
    | Kevin Spencer
    | .Net Developer
    | Microsoft MVP
    | Neither a follower
    | nor a lender be.
    |
    | "Dan" <-tuebingen.de> wrote in message
    | news:cnvogh$kgj$-tuebingen.de...
    | > hello all,
    | > is there a way to open a new window without javascript and a
    href=_blank?
    | > i need to connect a button click with some lines of code and then, a new
    | > window shall get opened.
    | > but i didn't find a way to opüen a new window as result of a buttonm
    | click.
    | >
    | > thanks for help,
    | > dan
    |
    |
    bruce barker, Nov 23, 2004
    #6
  7. Well, Bruce, as you know, there are precisely THREE ways to open a new
    browser window:

    1. JavaScript
    2. Target frame of hyperlink or form submit
    3. Get the User to do it.

    Which way would you use?

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Neither a follower
    nor a lender be.

    "bruce barker" <> wrote in message
    news:...
    > popup blockers prevent this approach - so I'd avoid it.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    > | I'm thinking that there must be some reason why you don't want to use
    > | JavaScript. Perhaps it's because you have some server-side processing to
    > do,
    > | which necessitates a PostBack, and you don't hink you can open a new
    > window
    > | once the page reloads. But you can. Just add the script using
    > | Page.RegisterStartupScript().
    > |
    > | --
    > | HTH,
    > | Kevin Spencer
    > | .Net Developer
    > | Microsoft MVP
    > | Neither a follower
    > | nor a lender be.
    > |
    > | "Dan" <-tuebingen.de> wrote in message
    > | news:cnvogh$kgj$-tuebingen.de...
    > | > hello all,
    > | > is there a way to open a new window without javascript and a
    > href=_blank?
    > | > i need to connect a button click with some lines of code and then, a

    new
    > | > window shall get opened.
    > | > but i didn't find a way to opüen a new window as result of a buttonm
    > | click.
    > | >
    > | > thanks for help,
    > | > dan
    > |
    > |
    >
    >
    Kevin Spencer, Nov 23, 2004
    #7
  8. Well Kevin I guess there are no other ways for Now!
    Patrick

    "Kevin Spencer" wrote:

    > Well, Bruce, as you know, there are precisely THREE ways to open a new
    > browser window:
    >
    > 1. JavaScript
    > 2. Target frame of hyperlink or form submit
    > 3. Get the User to do it.
    >
    > Which way would you use?
    >
    > --
    > HTH,
    > Kevin Spencer
    > ..Net Developer
    > Microsoft MVP
    > Neither a follower
    > nor a lender be.
    >
    > "bruce barker" <> wrote in message
    > news:...
    > > popup blockers prevent this approach - so I'd avoid it.
    > >
    > > -- bruce (sqlwork.com)
    > >
    > >
    > > "Kevin Spencer" <> wrote in message
    > > news:...
    > > | I'm thinking that there must be some reason why you don't want to use
    > > | JavaScript. Perhaps it's because you have some server-side processing to
    > > do,
    > > | which necessitates a PostBack, and you don't hink you can open a new
    > > window
    > > | once the page reloads. But you can. Just add the script using
    > > | Page.RegisterStartupScript().
    > > |
    > > | --
    > > | HTH,
    > > | Kevin Spencer
    > > | .Net Developer
    > > | Microsoft MVP
    > > | Neither a follower
    > > | nor a lender be.
    > > |
    > > | "Dan" <-tuebingen.de> wrote in message
    > > | news:cnvogh$kgj$-tuebingen.de...
    > > | > hello all,
    > > | > is there a way to open a new window without javascript and a
    > > href=_blank?
    > > | > i need to connect a button click with some lines of code and then, a

    > new
    > > | > window shall get opened.
    > > | > but i didn't find a way to opüen a new window as result of a buttonm
    > > | click.
    > > | >
    > > | > thanks for help,
    > > | > dan
    > > |
    > > |
    > >
    > >

    >
    >
    >
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Nov 23, 2004
    #8
  9. Dan

    Dan Guest

    the expectation was that the site must work with disabled js.
    and i don't want to use a link because before the new window will open,
    some server side action must be performed with data of the actual window.
    also, i cannot set the form target because not all the web controls have
    to perform a new page being opened.
    ok, then i have to take a two step navigation:
    1. button event takes starts server side action
    2. link click opens new window


    Patrick.O.Ige wrote:
    > Well Kevin I guess there are no other ways for Now!
    > Patrick
    >
    > "Kevin Spencer" wrote:
    >
    >
    >>Well, Bruce, as you know, there are precisely THREE ways to open a new
    >>browser window:
    >>
    >>1. JavaScript
    >>2. Target frame of hyperlink or form submit
    >>3. Get the User to do it.
    >>
    >>Which way would you use?
    >>
    >>--
    >>HTH,
    >>Kevin Spencer
    >>..Net Developer
    >>Microsoft MVP
    >>Neither a follower
    >>nor a lender be.
    >>
    >>"bruce barker" <> wrote in message
    >>news:...
    >>
    >>>popup blockers prevent this approach - so I'd avoid it.
    >>>
    >>>-- bruce (sqlwork.com)
    >>>
    >>>
    >>>"Kevin Spencer" <> wrote in message
    >>>news:...
    >>>| I'm thinking that there must be some reason why you don't want to use
    >>>| JavaScript. Perhaps it's because you have some server-side processing to
    >>>do,
    >>>| which necessitates a PostBack, and you don't hink you can open a new
    >>>window
    >>>| once the page reloads. But you can. Just add the script using
    >>>| Page.RegisterStartupScript().
    >>>|
    >>>| --
    >>>| HTH,
    >>>| Kevin Spencer
    >>>| .Net Developer
    >>>| Microsoft MVP
    >>>| Neither a follower
    >>>| nor a lender be.
    >>>|
    >>>| "Dan" <-tuebingen.de> wrote in message
    >>>| news:cnvogh$kgj$-tuebingen.de...
    >>>| > hello all,
    >>>| > is there a way to open a new window without javascript and a
    >>>href=_blank?
    >>>| > i need to connect a button click with some lines of code and then, a

    >>
    >>new
    >>
    >>>| > window shall get opened.
    >>>| > but i didn't find a way to opüen a new window as result of a buttonm
    >>>| click.
    >>>| >
    >>>| > thanks for help,
    >>>| > dan
    >>>|
    >>>|
    >>>
    >>>

    >>
    >>
    >>
    Dan, Nov 24, 2004
    #9
    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,740
    Patrik Löwendahl [C# MVP]
    Oct 10, 2004
  2. =?Utf-8?B?SmF3YWhhcg==?=

    Open new window using Javascript or Hyperlink

    =?Utf-8?B?SmF3YWhhcg==?=, May 11, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    15,463
    cicher
    Nov 19, 2008
  3. loga123
    Replies:
    9
    Views:
    7,629
    loga123
    Jun 8, 2006
  4. PC HUA
    Replies:
    2
    Views:
    406
    PC HUA
    May 19, 2004
  5. IveCal
    Replies:
    0
    Views:
    169
    IveCal
    Apr 2, 2007
Loading...

Share This Page