View Full Version : [EXAMPLE] AjaxEvent Usage Summary

Oct 08, 2008, 9:56 AM
A new example has been added to the explorer which demonstrates adding AjaxEvents to various Controls and html elements.


Personally I feel this is the most exciting feature of the whole Coolite Toolkit (or any ASP.NET webcontrol... Microsoft or 3rd party). The connection between the server and client is so easy to bridge now.

Let me know what you think.

Hope this help.

Oct 08, 2008, 12:52 PM
Personnally I find it simply awesome :/
Way better than having to add shared web methods. Now the drawback is that u post the full viewstate (I think at least), which will obviously slow the response time on page with huge viewstates (tho that's our job to avoid that :p).
But then I'm wondering about a few things.
Will it be gziped if gzip is enabled on server? Can it be automatically gzipped (by you :p)?
How will techniques such as this one : http://forums.asp.net/p/1293397/2513235.aspx works? I would be happy to try it, but I dn't really have the time right now, so I'm mainly asking for thoughts, as I intend to try it by myself later.
During some tests, I tried usig Response.Redirect which seems to fail (doesn't really surprise me, but maybe I just made a mistake). Is is really supposed to fail or not? If so, how would you handle redirect in such case?
Thx for reading this crap, big thx if u take time to answer :)

Oct 08, 2008, 1:05 PM
I posted this question before but didn't get a response. Let's try again =P.

What are the pros and cons of Coolite's AjaxEvent compared to WebService/PageMethod?? Isn't WebService/PageMethod still going to be faster? Does AjaxEvent post form data back to the server? With fiddler, I only see Viewstate being posted back in the example page.

Oct 08, 2008, 1:09 PM
As far as i know, PageMethod doesn't post ViewState back (which explains why you need a shared method or can't access to your page/user control controls), so I guess it "should" be faster. Can't promise tho :p

Oct 08, 2008, 1:39 PM
An each ajax request can be tuned individually.

The AjaxEvent has next two properties:

Type: possible values (Load, Submit). If Load then the form will not be be submitted on server (only user params). If Submit then form will be submit (including ViewState). I think we will add (in v0.7.0) one more type value: Submit without ViewState

EnableViewState: if true then server will return ViewState after ajax event. Default value is false which mean that ViewState will not be returned from server


<Click Type="Load" EnableViewState="true"></Click>

Oct 08, 2008, 8:42 PM
From your example we always need to EnableViewState="True" in order to retrieve the ViewState from a AjaxEvent response? Even when we have Type="Submit"selected?

Would be nice to only have to enable Type="Load" and opt out of EnableViewState if we want to :)


Oct 09, 2008, 9:29 PM

Just wondering exactly whats possible to effect in the response of an ajax event.

From looking at the examples and playing around myself, im not having much luck with anything other than setting the text of an ext: control.

Any chance you could provide a list of whats possible now and will be in the future. I appreciate that coolite is still in development :)

Im experimenting with (and would really like to) building coolite controls into my webapp. Given the current state of the codebase, would the best approach be to build in the existing controls using postback, then add full ajax support as necessary? Looking at what i just typed, seems to make sense ;)

Thanks for your help,


Oct 11, 2008, 12:55 AM
I too am interested in 'what' can be done, I am still trying out the toolkit as well. The examples are good. But I am still a little unclear on what can be done between the client and server. I see alot of "after" and 'before' events but I am unsure how to hook into them or how I would use them. I guess I'm missing the overview of how exactly how communication takes place between the client controls and server methods. Is there any documentation that goes into that?