473,395 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re: Client script not working on XP

"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:D4**********************************@microsof t.com...

Dave,
Thanks to both replies. I found out that the problem is that I have a
popup
blocker set to on for the computers in which the script does not work. I
don't understand this because I have used the following script hard coded
in
another web page and it isn't blocked yet if I use the same script in the
RegisterStartupScript it is blocked. The script code I used is as
follows:

string scriptText = "printWindow = window.open('','','width=400,
height=400');";
scriptText += "printWindow.document.open();";
scriptText += "printWindow.document.write(\"<html><head><body>So me
text</body></html>\");";
scriptText += "printWindow.document.close();";
cs.RegisterStartupScript(this.GetType(), "Testwindow", scriptText, true);
RegisterStartupScript is used to inject JavaScript into web pages - not
write out HTML.
http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx

By the way, you *really* are in the wrong newsgroup now...
If I change true to false in the RegisterStartupScript argument, nothing
displays at all.
The boolean override controls whether RegisterStarupScript creates the
opening and closing JavaScript <scripttags...
So my question is how can I write the script so it can bypass a popup
blocker?
You can't like this - that's what popup blockers are for!

You need something like this:
http://www.asp.net/ajax/ajaxcontrolt...odalpopup.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 30 '08 #1
1 1823
Mark;

I did post my question onto another forum. I can understand why popup
blockers will stop my script but why does it not stop the script that is hard
coded in another web page that I have successfully executed without being
blocked.
Dave

"Mark Rae [MVP]" wrote:
"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:D4**********************************@microsof t.com...

Dave,
Thanks to both replies. I found out that the problem is that I have a
popup
blocker set to on for the computers in which the script does not work. I
don't understand this because I have used the following script hard coded
in
another web page and it isn't blocked yet if I use the same script in the
RegisterStartupScript it is blocked. The script code I used is as
follows:

string scriptText = "printWindow = window.open('','','width=400,
height=400');";
scriptText += "printWindow.document.open();";
scriptText += "printWindow.document.write(\"<html><head><body>So me
text</body></html>\");";
scriptText += "printWindow.document.close();";
cs.RegisterStartupScript(this.GetType(), "Testwindow", scriptText, true);

RegisterStartupScript is used to inject JavaScript into web pages - not
write out HTML.
http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx

By the way, you *really* are in the wrong newsgroup now...
If I change true to false in the RegisterStartupScript argument, nothing
displays at all.

The boolean override controls whether RegisterStarupScript creates the
opening and closing JavaScript <scripttags...
So my question is how can I write the script so it can bypass a popup
blocker?

You can't like this - that's what popup blockers are for!

You need something like this:
http://www.asp.net/ajax/ajaxcontrolt...odalpopup.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 30 '08 #2

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

Similar topics

1
by: viktor9990 | last post by:
I have a page called CustomerSlides.aspx which contains an iframe(with the source Lookupage.aspx). The iframe page will look continuously in the database to see if a value has changed: if it is...
1
by: viktor9990 | last post by:
I have a page called CustomerSlides.aspx which contains an iframe(with the source Lookupage.aspx). The iframe page will look continuously in the database to see if a value has changed: if it is...
26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
5
by: vanisathish | last post by:
Hi I have an application, which has to change to different images based on some conditions. I am trying to call a javascript function(this function changes the images on the front end) from the...
0
by: viktor9990 | last post by:
I have a page called CustomerSlides.aspx which contains an iframe(with the source Lookupage.aspx). The iframe page will look continuously in the database to see if a value has changed: if it is...
7
by: Mike Rand | last post by:
I am having a really hard time trying to get some client side code hooked up in VS2005, ASP 2.0. The code is in an .inc file (vbscript). The first problem I am encountering is the ASP.NET page...
5
by: Alex Maghen | last post by:
I frequently find myself wanting to insert some basic client-side JavaScript functions in the page of an ASPX of mine. But I find it so frustrating that I have to actually contruct my JavaScript in...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
5
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...

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.