开发者

Turning an ASP.NET Website into an AJAX-Enabled one

开发者 https://www.devze.com 2023-03-10 03:53 出处:网络
I have successfully downloaded and installed AJAX framewor开发者_StackOverflow中文版k, and the control toolkit.

I have successfully downloaded and installed AJAX framewor开发者_StackOverflow中文版k, and the control toolkit.

While trying to insert any AJAX controls such as UpdatePanels or ScriptManagers into an existent ASP.NET Web Site (which currently has no AJAX functionalities) I get the following error:

"Attempret do read or write protected memory. This is often an indicator that other memory is corrupt."

So as a test, I've created a brand new project, as an ASP.NET AJAX-Enabled Web Site, as follows:


Turning an ASP.NET Website into an AJAX-Enabled one


And in the default page of this project there is an ScriptManager already, and I've been able to insert an UpdatePanel, do a little test with a label and a button updating its content to the current time.

The question is: What does an "ASP.NET AJAX-Enabled Web Site" have that an "ASP.NET Web Site" does not that prevents me from adding AJAX controls ?


Do you have more than one version of the AJAX libraries. Often times, the versions can be different between what you have set to use in the configuration file and the controls you are slapping on the page. That is the first place I would check.

You also need to make sure you have the correct version of both AJAX and the control library. This can be you downloaded an old control kit and are using the latest .NET framework, as much of the AJAX functionality has been included in .NET 4.0. Or it can be downloading newer bits and trying to use them with 2.0.


As far as I remember (it's been a while since I used AjaxControlToolkit) this error occurs when you attempt to modify the response stream from your code behind (ie: perform a Response.Write(); , or Response.End(); etc etc...

if the method your AsyncPostback trigger is calling is doing any kind of response stream modification then comment it out and try it again as a "proof of concept"..

hopefully this gets you going on the right track.

Dave

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号