Thursday, May 13, 2010

ClientSide Control

ClientSide controls are a lot of fun to create.Today, I am going to blog about one simple client control that I created which heavily uses javascript concepts like "Namespaces", "Singleton", "Closure", "Prototype Inheritance" etc.

QueryControl basically makes a Ajax call with the query thats typed in the textbox and shows its output. QueryControl is a client side control which encapsulates the functionality of
1) Making a ajax call and getting the Result by calling a handler.
2) Show the response in a placeHolder.

Many instances of the same control are added to the Page, and the control registers itself to a collection in its constructor.


I have not made the final output, pretty becuase my aim was to make the concepts clear rather than make the UI pretty. To really understand the code, you will have to debug it atleast once.

Code Sample: Download!!

--Yash