Showing posts with label experimenting. Show all posts
Showing posts with label experimenting. Show all posts

Monday, March 26, 2012

ASP.NET Ajax and VisualStudio2005

Hi there,

I've recently been experimenting with ASP.NET Ajax.
I'm able to create an Ajax Enabled website however Visual Studio doesn't seem to recognize the Asp.NET Ajax components...

When I'm viewing the web page in HTML format it doesn't even recognize the <asp:ScriptManager>.
What's really getting to me is that it doesn't recognize the<asp:UpdatePanel> nor the <contenttemplate>...andeverything within these tags, even though they are regular components(like text boxes and panels), shows up as errors.

Finding real problems in the HTML is difficult because there are so many error-swigglies underlining everything.


The site is works very well...and despite the fact that all theseerrors are listed, Visual Studio still compiles and runs the site.


Is there a way to make Visual Studio recognize the ASP.NET Ajax components?

Thanks

-Frinny

Have you added the Ajax/ControlToolkit components to the VS toolbar?

Yes, I have added it to the toolbar.

The site uses a bunch of different extenders and makes use of the update panels.
It works nicely but Visual Studio is showing the errors even though there are no errors.


That's odd.

When I enable Ajax, or ControlTookit, on existing asp.net pages the toolbar changes and the directives in the web.config seem to always do the trick.


So you don't see red-squggly error indicators when viewing the aspx as html?

Am I missing something? Did I not set this up correctly?


Have you registered the assembly in your aspx page?

<%

@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>


Yes I have <%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %> at the top of my pages.

This problem has been solved.

I was running Visual Studio 2005 without Service Pack 1.
Once I installed SP1 everything worked as it should...no more errors are showing up.

Thanks for all your help and advice!


-Frinny


Thanks for reporting back...You'll no doubt help a lot of others.Wink

Saturday, March 24, 2012

ASP.Net 2.0: Does using an UpdatePanel reduce back-end server load?

Hi there,

I have been experimenting with the AJAX Extensions for a while, and I have been looking at performance and other related characteristics of AJAX-izing my controls.

One question that came to mind is whether an AJAX-enabled control can reduce the back-end processing load. It might have been published somewhere before, so I apologize for the repeat in that case.

I noticed that when the client causes an AJAX postback through an UpdatePanel, it seems that the server would reload the entire web form and all its components/controls, but just sends the new UpdatePanel content back to the client. While this most certianly reduces egress, the back-end processing cost is not reduced. And with the help of AJAX controls, people tend to put more content on the same page. And in an obscure way, it actually increases server load, because the cost to refresh a portion of the page is computationally equal to a full refresh of the page, which is now more expensive because we put more content in a single page (i.e. more DB hits, etc).

I reckon that there might be documented ways to indicate that a custom control is somewhat "independent" in that a refresh does not require new data outside of the control itself (e.g. a custom control that just updates the current time every time the user clicks a button), but I haven't found any yet. Ideally, this control can live in a complicated page that requires several DB hits to refresh, but it would be great to have a way where a refresh postback to this AJAX control would cause the server to only execute the code of this control, and not re-process the entire page and incurr several extra DB hits.

If anyone knows of any such tricks or guidelines, I would really appreciate it if you could share. :-)

Thanks in advance,
- K.

hello.

well, the only way you have to build controls that integrate into ASP.NET and that are refreshed without full postbacks is to use the ICallbackEventHandler interface that was build into ASP.NET. btw, I'm not sure that you'll be gaining much by using this approach, but it exists.

regarding your remarks, what I can say is that web built AJAX pages will have most of their load in the client side, and will only use web services (or handlers) to get its data from the server side. This means that you'll have lots of JS to write, but again, that is why AJAX has a J, right?


Yes the UpdatePanel does not reduce the Server Load. Instead it offloads the data transfer of the wire and you should properly use it. To create more scalable application you can choose the Cient Centric Development Model but in that case you may have to write quite a lot of JavaScript depending upon the applicaiton you are building.

Regarding the ICallback of the Control also executes the full life cycle of the page. Moreover it only supports string for request/response as there is no serializer which does not do the conversation which is the case of Asp.net Ajax.


Thank you Kazi, I think this concurrs with my thinking and I appreciate your help.

However, others please chime in if you have other comments or nifty tricks that I can use. Smile

Thanks,
- K.