Saturday, March 24, 2012

question about the callback feature and scriptmanager

Hi,my application will have a textfield and a button (html control) and when the button is clicked, it will pass the textfield.value by calling a javascript function to the server side function and do something such as find the data in a database, after that it will return the result back to html page.

my question is, as far as I know I can use callback feature to do this, becuase what i need to do is register a page in the behind code. so the js function can call the registed function. However, as I know if use the scriptmanager and create a web serivce page with setting the class or specific methods as [scriptservice] attribute, then the js function can also call the code-behind function. therefore I wonder what is the different between those two feature. Hope someone can explain to me.

Ok, so you are using Callbacks instead of postbacks by using ICallBackHandler? Then you are also using MS AJAX? with ScriptManager?

You should only use one kind of AJAX. If you use only MS AJAX you won't have to use javascript to update your controls.

No comments:

Post a Comment