Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Wednesday, March 28, 2012

ASP.net AJAX throws errors in some browsers

These browsers are:

Mozilla (latest version)
Seamonkey (latest version)
Netscape (latest version)

See this error message:

AJAX error in diverse browsers

Has anyone encountered the same problems in the mentioned browsers? I couldn't check Mac browsers, any known issues in Mac browsers would be interesting too.
Any other browsers that don't like the asp.net AJAX?

This is normallly because you modify the response by using Response.write.Make sure you use a Literal control instead of using response.write.

Mac browsers will have the same error.

It's also possible that the error is caused by Tracing where the pageoutput is set to true. You must set that to false.
<traceenabled="true"requestLimit="128"pageOutput="false"traceMode="SortByTime"localOnly="false"/>


Hi Richard,

thanks for your reply. So I may not use <%= WhateverString %> neither, right? I can't use Response.Write in my code behind files and neither in the "HTML" source code, is that what you are saying?

Steve


Hi Steve,

Yes that is what I meand. I hope it helped you.


To be clear, <%= is just an alias for Response.Write; so there's no differnece at all once it compiels. If it helps, you *can* use Response.Write, just not inside an UpdatePanel, nor as part of any code that will be subject to responding to an update panel's asynch postback.

ASP.Net Ajax elements not being recognized

I've just installed ASP.Net Ajax beta 2 and added its references to web.config, but my project still gives me some errors (my project was originally created using ASP.Net Ajax beta 1 template).

Here they are:

Warning 1 The 'requirePermission' attribute is not declared. c:\Inetpub\wwwroot\n2_lc1\Web.config 7 206 c:\...\n2_lc1\
Warning 2 The 'requirePermission' attribute is not declared. c:\Inetpub\wwwroot\n2_lc1\Web.config 8 200 c:\...\n2_lc1\
Warning 3 The 'requirePermission' attribute is not declared. c:\Inetpub\wwwroot\n2_lc1\Web.config 9 214 c:\...\n2_lc1\
Error 28 Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site. c:\Inetpub\wwwroot\n2_lc1\processo\acompanhamento_corrida.aspx 32 7 c:\...\n2_lc1\

What can I do?

When I create a new project it works. With existing projects it doesn't work.

Try to take a look at this reading when upgrading to Ajax Beta 2 -
????http://66.102.7.104/search?q=cache:6kV1ivEIoIYJ:ajax.asp.net/files/Migration%2520Guide.doc+Upgrade+Ajax+Migration&hl=en&ct=clnk&cd=1
????http://ajax.asp.net/files/AspNet_AJAX_CTP_to_Beta_Whitepaper.aspx
Wish the above can give you some helps.

Jasson, thanks for your reply, but the problem isn't migrating an Atlas to Ajax code. The problem I have is about the prefix ASP for Ajax controls that Visual Studio Intellisense is not recognizing.

Visual Studio marks the Ajax elements as unknown. Their elements only work if I change Ajax prefix to another one (different from ASP).


Sorry for not giving you an immediate reply.For your questions, try to follow up the following suggestions.

Do you have the following code line when you want to access Ajax control toolkit? This is necessary to refer to Ajax control toolkit in your website project. If not,try to add it

Monday, March 26, 2012

ASP.NET AJAX Beta 2 Sys errors

I've just installed and created an animation using Beta 2.0.

The problems I'm experiencing are that I'm getting the following (javascript) errors.

'Sys.Application' is null or not an object
'Sys.UI.DomEvent' is null or not an object
'Sys.Res.argumentUndefined' is null or not an object
'Sys.Res.enumValueNotInteger' is null or not an object

After searching google and the forums I've tried numerous suggestions to no avail. I've managed to narrow the cause of the errors down to a specific place. I only receive the errors when I include a couple of javascript files that have nothing to do with ASP.NET AJAX and work well without the animation in the page. The big difference with the javascript files is that they are two libraries that we use heavily in the project -- AdvancedAjax and JSON. When they are not installed the animation works perfectly. I hope you can shed some light on what I might be doing wrong.

You might want to check Scott Guthries blog - it discusses a "Sys is Undefined" error but may be related

http://weblogs.asp.net/scottgu/archive/2006/10/29/Tip_2F00_Trick_3A00_-Handling-Errors-with-the-UpdatePanel-control-using-ASP.NET-AJAX.aspx


Thanks for the quick response. However, I've already been to the link and tried the fixes mentioned there. I've also added the following snippet to my web.config to get the animation to work on some pages (pages without the advance ajax and json libraries included)

<

locationpath="ScriptResource.axd">
<system.web>
<authorization>
<allowusers="*"/>
</authorization>
</system.web>
</location>

I've followed the asp.net ajax install tutorial and have triple checked that everything that needs to be in there is in there including the

<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.ScriptResourceHandler"validate="false"/>


Where in the web.config did you add that snipet?
just above the </configuration> at the end of the web.config...

The handler in the httphandlers section

<httpHandlers >
<removeverb="*"path="*.asmx" />
<addverb="*"path="*.asmx"validate="false"type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.ScriptResourceHandler"validate="false" />
</httpHandlers>

And the

<locationpath="ScriptResource.axd" >
<system.web >
<authorization >
<allowusers="*" />
</authorization >
</system.web >
</location>

Like jody said, at the very end before the </config> and after the asp.net ajax </system.WebServer> tag

I've also tried adding my javascript files to the script manager and notifying Sys.Application by following the following located at [here (pops in new win)]. This did not work either, the same problems happened that I first posted about.



<asp:ScriptManagerrunat="server"ID="ScriptManager1">
<Scripts>
<asp:ScriptReferencePath="~/scripts/script_file1.js"/>
<asp:ScriptReferencePath="~/scripts/script_file2.js"/>
</Scripts>
</asp:ScriptManager>

After upgrading to Beta 2, any functionality that needs to use functions inside those files, was giving errors?!

After reading the"Changes between the ASP.NET AJAX ("Atlas") CTP and the Beta 2 and RTM Releases", I come to know that every external Javascript files that being referenced from ScriptManager must have a call toSys.Application.notifyScriptLoader; this will notify the Sys.Applicationthat the script files has been downloaded to the client computer, so for each external .js file add the following snippet:

if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();

Another solution thatAlessandro Gallo hasblog it is to add the following snippet to the end of each .js file:

if(Sys &&Sys.Application) {Sys.Application.notifyScriptLoaded();}


I was investigating the same bunch of Sys.Application errors on my website and couldn't solve the issue until I found the thread. I checked my .js files and added the aforementioned code to the end of each but the error still continued to show up. So I decided to remove blocks of code from one .js file to see if any of them cause any problem. And I found a piece that caused the problem!

I have the following code:

Object.prototype.startsFrom = startsFrom;

function startsFrom ( s2 )
{
return (this.toString().substring(0, s2.length) == s2 )
}

As soon I comment this piece out (it's enough to comment the first line of the piece), the errors are gone!

So if anyone has the same problem - check for this "Object.prototype..." kind of code in your .js files!

Hope this helps.

Vlad.


If your namespaces begin with Microsoft.Web.* (as I see some of the examples here doing), then you're pointing to the wrong ASP.NET AJAX version, I think. The 1.0 release of ASP.NET AJAX uses the System.Web.* namespace and web.config settings need to be set accordingly. Starting from the web.config that comes with ASP.NET AJAX or the Toolkit should get things off on the right foot.

Probably an error takes place because you are using a DatePicker or somecontrol that uses Javascript and that interferes with Ajax.NET.

Verify that you arent using other Javascript.

Wednesday, March 21, 2012

asking about ajax 1.0 realesd ?

hi dev.

im using ajax 2.0 beta in my application. and i used ajax controls on it. now when i installed the new ajax all my pages had errors. can i do something easy to uypgrade it to new ajax? or stay on the beta version?

and if i stay use the beta does that make problems in the future?

thanks

Hey jaffar,

you might have a look atConverting Applications from "Atlas" CTP to ASP.NET AJAX RTM . Basically there a various naming scheme changes. E.g. the <atlas:XY tag changed to <asp:XY ...You also have a look at your web.config.

I suggest you to upgrade to the AJAX release version. The CTPs or betas are not supported, neither you can install current Control Toolkit builds.

regards

Henrik


hi henrikholle

the problem i uninstalled the beta one and installed the new one BUT the application gave me 101 errors DUH

so i think ajax team must thought about that and should do something. now i think i have to stay on the beta.


Hey,

just have a look at the converting guide. The guide describes the converting process from your beta version to RTM 1.0 in detail.Read here


regards

henrik