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 8 4259
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
"Dan" <da**********@zdv.uni-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 ma**********@NOSPAM.bytronic.com
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" <da**********@zdv.uni-tuebingen.de> wrote in message
news:cn**********@newsserv.zdv.uni-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
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" <da**********@zdv.uni-tuebingen.de> wrote in message
news:cn**********@newsserv.zdv.uni-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
popup blockers prevent this approach - so I'd avoid it.
-- bruce (sqlwork.com)
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:uc**************@TK2MSFTNGP15.phx.gbl...
| 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" <da**********@zdv.uni-tuebingen.de> wrote in message
| news:cn**********@newsserv.zdv.uni-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
|
|
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" <no***********@safeco.com> wrote in message
news:ef**************@TK2MSFTNGP14.phx.gbl... popup blockers prevent this approach - so I'd avoid it.
-- bruce (sqlwork.com)
"Kevin Spencer" <ks******@takempis.com> wrote in message news:uc**************@TK2MSFTNGP15.phx.gbl... | 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" <da**********@zdv.uni-tuebingen.de> wrote in message | news:cn**********@newsserv.zdv.uni-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 | |
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" <no***********@safeco.com> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl... popup blockers prevent this approach - so I'd avoid it.
-- bruce (sqlwork.com)
"Kevin Spencer" <ks******@takempis.com> wrote in message news:uc**************@TK2MSFTNGP15.phx.gbl... | 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" <da**********@zdv.uni-tuebingen.de> wrote in message | news:cn**********@newsserv.zdv.uni-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 | |
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" <no***********@safeco.com> wrote in message news:ef**************@TK2MSFTNGP14.phx.gbl...
popup blockers prevent this approach - so I'd avoid it.
-- bruce (sqlwork.com)
"Kevin Spencer" <ks******@takempis.com> wrote in message news:uc**************@TK2MSFTNGP15.phx.gbl... | 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" <da**********@zdv.uni-tuebingen.de> wrote in message | news:cn**********@newsserv.zdv.uni-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 | |
This discussion thread is closed Replies have been disabled for this discussion. Similar topics
18 posts
views
Thread by Paul |
last post: by
|
40 posts
views
Thread by Brian Jorgenson |
last post: by
|
4 posts
views
Thread by Olav Tollefsen |
last post: by
|
4 posts
views
Thread by KenG |
last post: by
|
5 posts
views
Thread by Chris |
last post: by
|
2 posts
views
Thread by Jawahar |
last post: by
|
9 posts
views
Thread by loga123 |
last post: by
|
9 posts
views
Thread by smokeyd |
last post: by
|
6 posts
views
Thread by bushi |
last post: by
| | | | | | | | | | |