Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

Saturday, March 24, 2012

Question about $ sign in ASP.NET AJAX

Hi,

I know that the $ sign has some special meaning like for shorthands functions ($get, $find, $addHandler, ...)

So at the moment I'm trying to get a grasp of the inner workings of this and saw this in the toolkit (which holds a wealth of information):

this._button$delegates = {
click : Function.createDelegate(this, this._button_onclick);
}

Like I see it this only creates a delegate to theeventhandler onclick of the button.

but does that $ in _button$delegates have any meaning? Or is it just convention to write it like that?

Grz, Kris.

The $ has no special meaning. The writers of the framework chose to use it to prepend certain common functions, and in they also used it as a naming convention for functions that would become methods.

Question about generated proxies

I'm looking at the following example where all of the functions calling web services use a common call back function.

http://www.asp.net/AJAX/Documentation/Live/ViewSample.aspx?sref=Sys.Net.WebServiceGenerics/cs/generics.js

I can see how organization might be a little better using the call back function and a switch statement, but are there performance benefits? Which would have better performance, individual call back functions or the all in one version? Are there any other benefits or detriments between the two?

thanks

Nick

There is no performance benifits in using a common callback. You can use the Common Callback when you have to process similar kind of logic for more than one web service call result.