Here is a brief overview of the new features and improvements of the componentart callback control for the web. ui 2006.1 release. our goal was to address common customer feature requests and make our callback framework more comprehensive. Viewstate Maintenance Starting with the 2006.1 release, you will be able to access the latest state of ASP. net controls contained on the page from your callback event handler. to enable this feature, simply set the poststate callback property to true. Passing multiple parameters from the callback. Callback () client-side Method We now support passing any number of simple-type parameters from the callback. Callback () call: Callback1.callback ('Stephen ', 'hatcher', 30, true ); These parameters will be available in the new string collection event ARGs member "Parameters ": StringFirstname = E. Parameters [0];StringLastname = E. Parameters [1];IntAge = convert. toint32 (E. Parameters [2]);BoolIsmanager = convert. toboolean (E. Parameters [3]);
Bypassing page Life Cycle We have noticed that pointer of our MERs have been using 3rd party Ajax libraries side-by-side with our callback control in order to be able to send quick commands to the server without going through page life cycle. this was a way to efficiently execute server-side logic when complex rendering through callbacks was not needed. we now provide this functionality out of the box through a custom HTTP handler. to take advantage of it, do the following: 1. Specify the HTTP handler within the <system. Web> section of your web. config file: <Httphandlers><AddType ="Componentart. Web. UI. callbackhandler, componentart. Web. UI" Path ="*. Aspx" Verb ="*" /></Httphandlers> 2. Mark all server-side methods you wish to expose on the client with the [componentartcallbackmethod] attribute. For example: [Componentartcallbackmethod]Public StringGetserverdatestring (){ReturnDatetime. Now. Date. tostring ("Mmmm DD, YYYY ");} Or [Componentartcallbackmethod]Public IntServersideadd (IntNumber1,IntNumber2 ){ReturnNumber1 + number2 ;} Note: You can have any number of simple-type arguments within the function signature. 3. You can then access those methods directly from your client-side JS Code: Alert (getserverdatestring ()); Or Alert ('server side: 2 + 2 = '+ serversideadd (2, 2 )); Automatic refresh Automatic callback Refresh can be enabled by setting the refreshinterval property to the desired time interval (in milliseconds ). you can use the client-side API to change the parameter (s) that are being sent to the server at any given time. We hope that you will enjoy the new features of componentart callback 2006.1. The componentart team Helping you build something amazing |