Saturday, March 24, 2012

Open a file in a a new window

Hi,
On a web form, in the click event of a button I want to open a .htm file in
a new window. However I only know the path of the shortcut which points to
file that needs to be viewed in the new window. What server side code do I
use to do the above ?
Thanks a ton.From your server, you can't open a window on the client's machine. What you
can do, however, is emit client side code to do that. You could just emit a
window.open script to the client, which will let you write it out in real
time, but that involves a round trip. Why not just create an input
type=button linked to a javascript function that opens the window that you
need, and spare yourself the traffic over the wire?

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Anita C" <anitac@.ptm-software.com> wrote in message
news:O1nrmQKpDHA.2140@.TK2MSFTNGP09.phx.gbl...
> Hi,
> On a web form, in the click event of a button I want to open a .htm file
in
> a new window. However I only know the path of the shortcut which points to
> file that needs to be viewed in the new window. What server side code do I
> use to do the above ?
> Thanks a ton.
Thanks, that is what i intend to do, however I have a bigger problem in
trying to :
Read the properties of the shortcut in question the 'Target' property shows
the path of the file the shortcut points to. Is possible in asp.net to load
the shortcut and read the target property ? If so how ? A code sample will
be great.
Thanks.

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:eXgByULpDHA.488@.tk2msftngp13.phx.gbl...
> From your server, you can't open a window on the client's machine. What
you
> can do, however, is emit client side code to do that. You could just emit
a
> window.open script to the client, which will let you write it out in real
> time, but that involves a round trip. Why not just create an input
> type=button linked to a javascript function that opens the window that you
> need, and spare yourself the traffic over the wire?
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows XP
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Anita C" <anitac@.ptm-software.com> wrote in message
> news:O1nrmQKpDHA.2140@.TK2MSFTNGP09.phx.gbl...
> > Hi,
> > On a web form, in the click event of a button I want to open a .htm file
> in
> > a new window. However I only know the path of the shortcut which points
to
> > file that needs to be viewed in the new window. What server side code do
I
> > use to do the above ?
> > Thanks a ton.

0 comments:

Post a Comment