473,770 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open & RegisterClientS criptBlock

Hello,

I try to open a new Window in code behind with :
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open('t oto.doc');", true);

My problem is that the new window is created but it disappears immediatly
just after creation!!

For information, I tried this:

ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.locatio n=''toto.doc';" , true);

IE7 ask me to validate the download in the top of the browser (it is a
security message that we have to validate to continue...)

I tried also this:

ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open(Im age.jpg');", true);

I have a new Window with my image!

In fact, it doesn't work with files that need to have the validation message
(open, save to disk, cancel)

How can I download these kind of files ?

Thanks,

David.
Jul 10 '07 #1
3 6636
On Jul 11, 5:13 am, <Davidwrote:
Hello,

I try to open a new Window in code behind with :
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open('t oto.doc');", true);

My problem is that the new window is created but it disappears immediatly
just after creation!!

For information, I tried this:

ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.locatio n=''toto.doc';" , true);

IE7 ask me to validate the download in the top of the browser (it is a
security message that we have to validate to continue...)

I tried also this:

ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open(Im age.jpg');", true);

I have a new Window with my image!

In fact, it doesn't work with files that need to have the validation message
(open, save to disk, cancel)

How can I download these kind of files ?

Thanks,

David.
hi,
try this from code behind hope help

//Set the appropriate ContentType.
Response.Conten tType = "Applicatio n/doc";
//Get the physical path to the file.
string FilePath = MapPath("s.doc" );
//Write the file directly to the HTTP content output stream.
Response.WriteF ile(FilePath);
Response.End();

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd

Jul 10 '07 #2
Hi,

Sorry but I have an error message on my page :
The XML page can't be displayed ...

A bad caracter has been found in a text content...

More, I want to open a new window with the content file inside, not the the
page itself.

In fact, this code could work :
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open('t oto.doc');", true);

Maybe a parameter in IE7 to change ?
Why my new page begins to be displayed and disappears immediatly ?
Why does it work with a text file or an image file ?

Thanks in advance,
David.
"nahid" <na******@gmail .coma écrit dans le message de news:
11************* *********@n2g20 00...legro ups.com...
On Jul 11, 5:13 am, <Davidwrote:
>Hello,

I try to open a new Window in code behind with :
ClientScript.R egisterClientSc riptBlock(this. GetType(), "MyOpenScri pt",
"window.open(' toto.doc');", true);

My problem is that the new window is created but it disappears immediatly
just after creation!!

For information, I tried this:

ClientScript.R egisterClientSc riptBlock(this. GetType(), "MyOpenScri pt",
"window.locati on=''toto.doc'; ", true);

IE7 ask me to validate the download in the top of the browser (it is a
security message that we have to validate to continue...)

I tried also this:

ClientScript.R egisterClientSc riptBlock(this. GetType(), "MyOpenScri pt",
"window.open(I mage.jpg');", true);

I have a new Window with my image!

In fact, it doesn't work with files that need to have the validation
message
(open, save to disk, cancel)

How can I download these kind of files ?

Thanks,

David.

hi,
try this from code behind hope help

//Set the appropriate ContentType.
Response.Conten tType = "Applicatio n/doc";
//Get the physical path to the file.
string FilePath = MapPath("s.doc" );
//Write the file directly to the HTTP content output stream.
Response.WriteF ile(FilePath);
Response.End();

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd

Jul 11 '07 #3
In fact, I have to encode as "applicatio n/msword"

It works but I still want to create a new window...

If I use the code Response.WriteF ile in a second webpage and I call it from
my startpage with RegisterClientS criptBlock and window.open, the problem is
still here!
I hear the sound like IE blocks a new popup window even if I authorize IE...

What can I do else?
Thanks.

<Davida écrit dans le message de news:
eo************* ***@TK2MSFTNGP0 3.phx.gbl...
Hi,

Sorry but I have an error message on my page :
The XML page can't be displayed ...

A bad caracter has been found in a text content...

More, I want to open a new window with the content file inside, not the
the page itself.

In fact, this code could work :
ClientScript.Re gisterClientScr iptBlock(this.G etType(), "MyOpenScri pt",
"window.open('t oto.doc');", true);

Maybe a parameter in IE7 to change ?
Why my new page begins to be displayed and disappears immediatly ?
Why does it work with a text file or an image file ?

Thanks in advance,
David.
"nahid" <na******@gmail .coma écrit dans le message de news:
11************* *********@n2g20 00...legro ups.com...
>On Jul 11, 5:13 am, <Davidwrote:
>>Hello,

I try to open a new Window in code behind with :
ClientScript. RegisterClientS criptBlock(this .GetType(), "MyOpenScri pt",
"window.open( 'toto.doc');", true);

My problem is that the new window is created but it disappears
immediatly
just after creation!!

For information, I tried this:

ClientScript. RegisterClientS criptBlock(this .GetType(), "MyOpenScri pt",
"window.locat ion=''toto.doc' ;", true);

IE7 ask me to validate the download in the top of the browser (it is a
security message that we have to validate to continue...)

I tried also this:

ClientScript. RegisterClientS criptBlock(this .GetType(), "MyOpenScri pt",
"window.open( Image.jpg');", true);

I have a new Window with my image!

In fact, it doesn't work with files that need to have the validation
message
(open, save to disk, cancel)

How can I download these kind of files ?

Thanks,

David.

hi,
try this from code behind hope help

//Set the appropriate ContentType.
Response.Conten tType = "Applicatio n/doc";
//Get the physical path to the file.
string FilePath = MapPath("s.doc" );
//Write the file directly to the HTTP content output stream.
Response.WriteF ile(FilePath);
Response.End();

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd


Jul 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
34888
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen as a new window. The original window plus the Modally opened Pop remain in a separate window. What I want to do is close the popup and return to the original window with its view state maintained. The control use to fire the popup window...
8
1925
by: VB Programmer | last post by:
On some websites I've seen by clicking on a button or hlink a new IE browser window is spawned that does NOT have any toolbar (ie No back button, etc...) How can I do this on my ASPX page? Thanks.
4
5084
by: DM | last post by:
Is there any way, using a server control, to execute a routine (say, add record to database) and then close the browser window. I'm having a difficult time doing this using a master\detail model where dialog apsx page is opened when datagrid item on master page is clicked. Would like to be able to have detail open in the html dialog where user can edit record, then click save button to save changes to database, call opener routine to...
8
1859
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res image would be in the main window and would have a button that when pressed brings up the "popup" window that has the high-res image. I would like the window to be re-used instead of creating yet another popup window if the user navigates to another...
0
1913
by: IndyChris | last post by:
I've got a button my webpage that when clicked will open another window. Different criteria on the page will deteremine which window gets opened when the button is clicked. I have a switch statement in my code and then I set up javascript that I register back to the client. This is all working fine except for one thing. The window that opens, opens behind the parent window. I was really hoping that it would open in front. I believe that...
9
4657
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" + "}" + "</script>";
9
3156
by: smokeyd | last post by:
hi, can anyone tell me how to open a link in a new browser window in vbscript.net. i am looking to be able to set the properties such as size, menu bar, scroll bar etc. or alternativelly is there a simple way to do this in visual web developer? many thanks in advance for your help.
6
2072
by: SAL | last post by:
Hi, VS2005 post I'm opening a window using the following syntax: Protected Sub lbEstValue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Write("<script>window.open('EstValueHelp.aspx','_help', 'width=400,height=400');</script>") End Sub
1
4499
by: Ramachand | last post by:
Actually I have to call a dialog window "Dwin1" from a Parent Window. From Dwin1, I have to call another Dialog Window "Dwin2".if user close the Dialog Window "Dwin2", i have to refersh the Dwin1. If user close Dwin1, i have to refresh the Parent Window. For opening a Dwin1 , should not be a problem.but if i open the another dialog Dwin2 from Dwin1, it's opening like a seperate window Dwin1 . From there it's opening the Dialog Open Dwin1...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.