By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

open a new window without javascript and without hyperlink

P: n/a
Dan
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
Nov 18 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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

Nov 18 '05 #2

P: n/a
"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
Nov 18 '05 #3

P: n/a
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

Nov 18 '05 #4

P: n/a
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

Nov 18 '05 #5

P: n/a
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
|
|
Nov 18 '05 #6

P: n/a
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
|
|

Nov 18 '05 #7

P: n/a
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
|
|


Nov 18 '05 #8

P: n/a
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
|
|


Nov 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.