PC Review


Reply
Thread Tools Rate Thread

Client script not working on XP

 
 
Parrot
Guest
Posts: n/a
 
      30th Oct 2008
I am using a client startup script in my web page to display some data from
my Calendar control in C#. I uploaded the new web page to my server and it
runs fine when I pull up the web page from my Vista computer. However, if I
try to bring up the web page from another computer that has XP it does not
work. The script has the following format:

ClientScript.RegisterStartupScript(this.GetType(),
> "Popup", scriptText", true);


Can anyone tell me what is missing on my XP computer that prevents the
script from working? I am using Net Framework 3.5 and developed with Visual
Studio 2008. It appears to me that Net Framework 3.5 has to be installed on
the client side computer in order for the script to work. Is that true? If
so, how do I install NET 3.5 on all of my viewers computers? There has to be
another answer.
Dave
 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      30th Oct 2008
No, the .NET Runtime does not need to be installed on the client in order
for the script to work, it only needs to be installed on the webserver
(that's where the .NET code is being executed). What gets sent to the client
is simply html and JavaScript generated by the webserver, the same stuff you
see when you do a View Source. I am guessing that your problem is browser
related. Are all the machines using the same browser and version of that
browser? Do the browser settings on any of the machines restrict scripts in
any way? On the XP machines, does it give an error or just ignore the script
(in other words, does the rest of the page show)? If it does give an error,
what is that error? Hopefully some of this will help you find the solution,
if not, post the answers to these questions here and maybe someone can help
you more then. Good Luck!
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Parrot" <(E-Mail Removed)> wrote in message
news:275BC682-8EA6-4B76-B852-(E-Mail Removed)...
>I am using a client startup script in my web page to display some data from
> my Calendar control in C#. I uploaded the new web page to my server and
> it
> runs fine when I pull up the web page from my Vista computer. However, if
> I
> try to bring up the web page from another computer that has XP it does not
> work. The script has the following format:
>
> ClientScript.RegisterStartupScript(this.GetType(),
>> "Popup", scriptText", true);

>
> Can anyone tell me what is missing on my XP computer that prevents the
> script from working? I am using Net Framework 3.5 and developed with
> Visual
> Studio 2008. It appears to me that Net Framework 3.5 has to be installed
> on
> the client side computer in order for the script to work. Is that true?
> If
> so, how do I install NET 3.5 on all of my viewers computers? There has to
> be
> another answer.
> Dave



 
Reply With Quote
 
Parrot
Guest
Posts: n/a
 
      30th Oct 2008
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>Some
text</body></html>\");";
scriptText += "printWindow.document.close();";
cs.RegisterStartupScript(this.GetType(), "Testwindow", scriptText, true);

If I change true to false in the RegisterStartupScript argument, nothing
displays at all. So my question is how can I write the script so it can
bypass a popup blocker?

Dave

"Mark Rae [MVP]" wrote:

> "Parrot" <(E-Mail Removed)> wrote in message
> news:275BC682-8EA6-4B76-B852-(E-Mail Removed)...
>
> Dave,
>
> > Can anyone tell me what is missing on my XP computer that prevents the
> > script from working?

>
> Almost certainly, an error in the script itself.
>
> > I am using Net Framework 3.5 and developed with Visual Studio 2008.

>
> That's good.
>
> > It appears to me that Net Framework 3.5 has to be installed on the client
> > side computer in order for the script to work. Is that true?

>
> No it is not.
>
> > There has to be another answer.

>
> I would suggest that you create a new post in
> microsoft.public.dotnet.framework.aspnet, since this is not really a C#
> problem.
>
> Make sure that you include the full contents of the scriptText variable...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
Parrot
Guest
Posts: n/a
 
      30th Oct 2008
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" <(E-Mail Removed)> wrote in message
> news44A43E9-B6BA-4AC9-B946-(E-Mail Removed)...
>
> 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>Some
> > 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 <script> tags...
>
> > 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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Odd script error when using client script callbacks (ASP.NET 2.0) =?Utf-8?B?TG93bGFuZGVy?= Microsoft ASP .NET 0 27th Mar 2007 11:30 PM
Client script callbacks not working outside Visual Studio aBs0lut30 Microsoft ASP .NET 0 10th Aug 2006 08:49 PM
Server-side script with input parameter from Client-side script Magnus Blomberg Microsoft ASP .NET 3 14th Apr 2005 01:21 PM
Registerd Client Script Not Working Red Microsoft ASP .NET 1 24th Apr 2004 06:56 PM
How to trigger client script from server script? Manu Microsoft C# .NET 2 15th Sep 2003 02:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 PM.