Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I open a new browser window programmatically?

Reply
Thread Tools

How do I open a new browser window programmatically?

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-03-2005
How do I open and change properties of (such as size, position, scroll
position, visibility of toolbars, etc.) a browser window? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Roy
Guest
Posts: n/a
 
      06-03-2005
Use javascript.

<SCRIPT LANGUAGE="javascript">window.open('somepage.html') </SCRIPT>

is the basic syntax.


Nathan Sokalski wrote:
> How do I open and change properties of (such as size, position, scroll
> position, visibility of toolbars, etc.) a browser window? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-03-2005
I know how to open a new window using Javascript, and id I have to manually
write the Javascript that's OK, but how do I call the Javascript from a
method in ASP.NET code? For example, I want the new window to open when a
specific event occurs on my page. (I use VB.NET as my language when making
my ASP.NET pages) How do I do this? Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Roy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Use javascript.
>
> <SCRIPT LANGUAGE="javascript">window.open('somepage.html') </SCRIPT>
>
> is the basic syntax.
>
>
> Nathan Sokalski wrote:
>> How do I open and change properties of (such as size, position, scroll
>> position, visibility of toolbars, etc.) a browser window? Thanks.
>> --
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/

>



 
Reply With Quote
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      06-03-2005
You can open windows with the javascript window.open method.
Here's more info:
http://SteveOrr.net/articles/ClientSideSuite.aspx
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

Some popup blockers may foil your plans however, so consider alternate
designs.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I open and change properties of (such as size, position, scroll
> position, visibility of toolbars, etc.) a browser window? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-03-2005
I understand everything about the Javascript window.open method and how
popup blockers may cause problems when using it. This is why I have been
looking for a way to open a new browser window using ASP.NET without
manually writing the Javascript. But if I do use Javascript, how do I tell
ASP.NET code written in VB.NET to call it? The specific purpose I plan to
use this for is when to open a printable version of a page when the user
clicks a button. I would rather use an ImageButton control than nest and
Image control inside of a HyperLink control with a Target property of
_blank. This way I can use less controls and I would also like to use the
CommandArgument property of the ImageButton control. Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Steve C. Orr [MVP, MCSD]" <(E-Mail Removed)> wrote in message
news:OPITS%(E-Mail Removed)...
> You can open windows with the javascript window.open method.
> Here's more info:
> http://SteveOrr.net/articles/ClientSideSuite.aspx
> http://msdn.microsoft.com/workshop/a...ods/open_0.asp
>
> Some popup blockers may foil your plans however, so consider alternate
> designs.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How do I open and change properties of (such as size, position, scroll
>> position, visibility of toolbars, etc.) a browser window? Thanks.
>> --
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
Roy
Guest
Posts: n/a
 
      06-04-2005
I noticed from your other message that you're trying to use ASP.NET to
open a new window. Long story short: you can't (or at least not in any
comparably simple way that javascript allows for). Ya gotta use
javascript.

I did a job similar to what you're describing not too long ago. I
placed the javascript syntax within a global VB variable in the
page_load area. You may already know that VB.NET = server-side and
javascript = client-side. By placing the javascript within a VB
variable you get around this and sorta merge the two, but I digress...
In the button click event (I was using a <asp:buttton> in my job) I did
a response.write() *using that variable* and thusly passed back the
javascript back to the client for processing.



Nathan Sokalski wrote:
> I know how to open a new window using Javascript, and id I have to manually
> write the Javascript that's OK, but how do I call the Javascript from a
> method in ASP.NET code? For example, I want the new window to open when a
> specific event occurs on my page. (I use VB.NET as my language when making
> my ASP.NET pages) How do I do this? Thanks.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use an asp:button to create a new browser window and output contents to new window =?Utf-8?B?Tm92aWNl?= ASP .Net 2 06-09-2004 10:54 PM
How do I open a new normal (full sized) browser window form a small "pop-up" window? Shiperton Henethe HTML 17 05-21-2004 07:36 AM
window.open() doesn't open new Window in Opera PC HUA Javascript 2 05-19-2004 02:29 AM
Need to open a new browser window, not a new window Gordon ASP General 3 04-16-2004 10:46 PM
Session problem with new IE browser window from window.open() raj Javascript 0 04-07-2004 09:08 PM



Advertisments