Which two actions should you perform?

You are debugging an ASP.NET web page. The page includes the following method:
[WebMethod]
public string GetServerString()
{

}
The page also includes the following markup:
<asp:ScriptManager ID=”sm1″ runat=”server” />
The following JavaScript code is used to call the GetServerStringmethod:
function GetString() {
PageMethods.GetServerString(callbackMethod);
}
function callbackMethod(str) {

}
The AJAX calls to the GetServerStringmethod are failing.
You need to ensure that the AJAX call to the GetServerStringmethod succeeds.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

You are debugging an ASP.NET web page. The page includes the following method:
[WebMethod]
public string GetServerString()
{

}
The page also includes the following markup:
<asp:ScriptManager ID=”sm1″ runat=”server” />
The following JavaScript code is used to call the GetServerStringmethod:
function GetString() {
PageMethods.GetServerString(callbackMethod);
}
function callbackMethod(str) {

}
The AJAX calls to the GetServerStringmethod are failing.
You need to ensure that the AJAX call to the GetServerStringmethod succeeds.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

A.
Set the EnablePageMethodsproperty of the ScriptManagercontrol to true.

B.
Set the EnablePartialRenderingproperty of the ScriptManagercontrol to true.

C.
Change the WebMethodattribute of the GetServerStringmethod to WebMethod(EnableSession=true).

D.
Declare the GetServerStringmethod as static.



Leave a Reply 0

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