Which approach should you recommend?

You need to design a solution for calling a server-side method of the code-behind file from JavaScript.
Which approach should you recommend?

You need to design a solution for calling a server-side method of the code-behind file from JavaScript.
Which approach should you recommend?

A.
Use PageMethods.

B.
Use an UpdatePanel control.

C.
Use an UpdateProgress control.

D.
Configure the server-side method to return a JsonResult.

Explanation:
If you prefer not to reload the page, you can use one of these techniques to allow clientside code to call server-side methods and process the results:
Page methods Mark the static method you want to expose with the WebMethod attribute, add a ScriptManager server control, and set ScriptManager.EnablePageMethods to true. Then you can use the PageMethods object within JavaScript to call server-side methods and process the results.



Leave a Reply 0

Your email address will not be published. Required fields are marked *