<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX Discussion and Suggestions</title><link>http://forums.asp.net/1007.aspx</link><description>This forum is the place for ASP.NET AJAX 'getting started' questions, general questions that don't fit in one of the other forums about AJAX </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/2166780.aspx</link><pubDate>Mon, 11 Feb 2008 22:38:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2166780</guid><dc:creator>APIJunkie</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2166780.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=2166780</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" dir="ltr"&gt;Hi Steve,&lt;/p&gt;
&lt;p class="MsoNormal" dir="ltr"&gt;Thank you for the info.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;One thing I would like to add is that if you are using master pages or need json.js script inside custom controls you can use the script manager proxy Scripts property instead of the script manager Scripts property. &lt;/p&gt;
&lt;p class="MsoNormal" dir="ltr"&gt;&lt;a href="http://www.apijunkie.com/APIJunkie/blog/post.aspx?id=4825ca2c-690e-4997-9cd6-f0b69e208b10"&gt;Trackback&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1589023.aspx</link><pubDate>Wed, 21 Feb 2007 21:36:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1589023</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1589023.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1589023</wfw:commentRss><description>&lt;p&gt;Okay, the trouble is that json.js extends Object itself (a common cause of conflicts between AJAX libraries), so everything gets the .toJSONString() method attached.&amp;nbsp; This is a problem when the Microsoft AJAX Library tries to register its enumerations.&amp;nbsp; Type.registerEnum() tries to verify that the only values inside the enum are numbers, but the one called 'toJSONString' is a function, so it throws.&lt;/p&gt;
&lt;p&gt;One solution is to include json.js after including MicrosoftAjax.js.&amp;nbsp; The best way to do that would be to register the script with the ScriptManager, like:&lt;/p&gt;&lt;pre class=coloredcode&gt;        &amp;lt;&lt;span class=tag&gt;asp:ScriptManager&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"ScriptManager1"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&amp;gt;
            &amp;lt;&lt;span class=tag&gt;Scripts&lt;/span&gt;&amp;gt;
                &amp;lt;&lt;span class=tag&gt;asp:ScriptReference&lt;/span&gt;&lt;span class=attr&gt; Path=&lt;/span&gt;&lt;span class=attrv&gt;"json.js"&lt;/span&gt; /&amp;gt;
            &amp;lt;/&lt;span class=tag&gt;Scripts&lt;/span&gt;&amp;gt;
        &amp;lt;/&lt;span class=tag&gt;asp:ScriptManager&lt;/span&gt;&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This is probably not an option for you, because json.js is getting included by another control that you can't change.&lt;/p&gt;
&lt;p&gt;Another option is to edit json.js (probably not possible if it's embedded in the control you're using?) or undo the change json.js makes to Object, like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class=tag&gt;script&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"text/javascript"&lt;/span&gt;&lt;span class=attr&gt; src=&lt;/span&gt;&lt;span class=attrv&gt;"json.js"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class=tag&gt;script&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;span class=tag&gt;script&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete Object.prototype.toJSONString;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;span class=tag&gt;script&lt;/span&gt;&amp;gt; 
&lt;p&gt;This&amp;nbsp;assumes that the&amp;nbsp;extension of the actual Object prototype&amp;nbsp;isn't needed.&amp;nbsp; (It already also extends Array, Boolean, Date, Number, and String.&amp;nbsp; Maybe that's sufficient for what it's being used for.)&lt;/p&gt;
&lt;p&gt;The last idea I have would be to modify MicrosoftAjax.js itself.&amp;nbsp; You can do that by copying down the Microsoft AJAX Library from ajax.asp.net, and then pointing the ScriptManager to your version via the ScriptPath attribute.&amp;nbsp; Then you can modify the scripts as you like.&amp;nbsp; Specifically, you'd have to at least comment out lines 2421 and 2422 of MicrosoftAjax.debug.js (and/or the corresponding lines of MicrosoftAjax.js).&lt;/p&gt;
&lt;p&gt;Note that this doesn't seem to be an issue when debug="false", so maybe you can get by without having to do one of these changes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope that helps, and sorry I don't have a better answer for you.&lt;/p&gt;&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1589002.aspx</link><pubDate>Wed, 21 Feb 2007 21:14:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1589002</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1589002.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1589002</wfw:commentRss><description>&lt;p&gt;Ah!&amp;nbsp; I was running with debug="false", but I do get an error if I use debug="true".&lt;/p&gt;
&lt;p&gt;Investigating a little further...&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1588996.aspx</link><pubDate>Wed, 21 Feb 2007 21:11:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1588996</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1588996.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1588996</wfw:commentRss><description>&lt;p&gt;Strange, that's almost exactly the same code I tried.&amp;nbsp; Let me play some more with this and see if I can repro.&lt;/p&gt;
&lt;p&gt;Just to be sure, we're talking about &lt;a href="http://json.org/json.js"&gt;http://json.org/json.js&lt;/a&gt;, right?&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1588811.aspx</link><pubDate>Wed, 21 Feb 2007 18:52:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1588811</guid><dc:creator>paultyng</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1588811.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1588811</wfw:commentRss><description>&lt;p&gt;The specific error I get is: Microsoft JScript runtime error: 'Sys.Res.enumValueNotInteger' is null or not an object&lt;/p&gt;
&lt;p&gt;The error occurs in the ScriptResource.axd request for AJAX script.&amp;nbsp; I'm not sure what else to tell you for repro, I don't have any update panels, I don't have any AJAX code, just a ScriptManager (with enable partial rendering = "true")&amp;nbsp;and the JSON.JS script referenced.&amp;nbsp; I have the release of AJAX.&amp;nbsp; If i comment out JSON.js, no errors, if I put it back, I get the above error.&amp;nbsp; This is just on my login page, I have only a Login control and some static HTML (and the ScriptManager).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Line 2421 of &lt;span class=sourceRowText&gt;MicrosoftAjax.js&lt;/span&gt;:&amp;nbsp;&lt;span class=sourceRowText&gt;if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=sourceRowText&gt;&amp;nbsp;Here is my page source:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=sourceRowText&gt;&amp;nbsp;&lt;pre class=coloredcode&gt;&lt;span class=dir&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="errortest.aspx.cs" Inherits="System_errortest" %&amp;gt;&lt;/span&gt;

&amp;lt;&lt;span class=tag&gt;!DOCTYPE&lt;/span&gt; html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;&lt;span class=tag&gt;html&lt;/span&gt;&lt;span class=attr&gt; xmlns=&lt;/span&gt;&lt;span class=attrv&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt; &amp;gt;
&amp;lt;&lt;span class=tag&gt;head&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;Untitled Page&amp;lt;/&lt;span class=tag&gt;title&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;script&lt;/span&gt;&lt;span class=attr&gt; type=&lt;/span&gt;&lt;span class=attrv&gt;"text/javascript"&lt;/span&gt;&lt;span class=attr&gt; src=&lt;/span&gt;&lt;span class=attrv&gt;"../3p/json/json.js"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class=tag&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class=tag&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;form&lt;/span&gt;&lt;span class=attr&gt; id=&lt;/span&gt;&lt;span class=attrv&gt;"form1"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class=tag&gt;asp:ScriptManager&lt;/span&gt;&lt;span class=attr&gt; ID=&lt;/span&gt;&lt;span class=attrv&gt;"sm"&lt;/span&gt;&lt;span class=attr&gt; runat=&lt;/span&gt;&lt;span class=attrv&gt;"server"&lt;/span&gt;&lt;span class=attr&gt; EnablePartialRendering=&lt;/span&gt;&lt;span class=attrv&gt;"true"&lt;/span&gt; /&amp;gt;
    &amp;lt;/&lt;span class=tag&gt;form&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class=tag&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class=tag&gt;html&lt;/span&gt;&amp;gt;
&lt;/pre&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1587511.aspx</link><pubDate>Wed, 21 Feb 2007 00:48:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1587511</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1587511.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1587511</wfw:commentRss><description>&lt;p&gt;I just made a simple page with a ScriptManager and a reference to json.js, and it loads fine with no error.&lt;/p&gt;
&lt;p&gt;So for now, I can't reproduce your issue, so I can't help.&amp;nbsp; If you can provide some code that demonstrates the problem, then I might be able to help.&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1586523.aspx</link><pubDate>Tue, 20 Feb 2007 13:54:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1586523</guid><dc:creator>paultyng</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1586523.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1586523</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://forums.asp.net/thread/1440390.aspx" title="http://forums.asp.net/thread/1440390.aspx" target="_blank"&gt;http://forums.asp.net/thread/1440390.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;I found a similar problem on that thread, the problem is I can't use the methods that ASP.NET AJAX exposes for JSON because the json.js library is already built in to the 3rd party control I'm using.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: json.js and AJAX</title><link>http://forums.asp.net/thread/1585742.aspx</link><pubDate>Mon, 19 Feb 2007 23:43:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1585742</guid><dc:creator>Garbin</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1585742.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1585742</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;which kind of errors are you getting?&lt;/p&gt;</description></item><item><title>json.js and AJAX</title><link>http://forums.asp.net/thread/1585317.aspx</link><pubDate>Mon, 19 Feb 2007 17:44:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1585317</guid><dc:creator>paultyng</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1585317.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1007&amp;PostID=1585317</wfw:commentRss><description>&lt;p&gt;Is there a way to get around the compatibilities between the JSON implementation on &lt;a href="http://www.json.net/"&gt;http://www.json.net&lt;/a&gt; (json.js) which is supposedly going to become part of the JavaScript programming language and ASP.NET AJAX's javascript libraries?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;json.js is a legacy requirement of an app I'm working on and I'd like to use AJAX as well but it doesn't seem like the two play nicely together...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Paul&lt;/p&gt;</description></item></channel></rss>