JavaScript Function:
function CreateProposal(GetProposal, ProductName, ProductID) {
$.ajax({
type: "POST",
url: "Page.ascx/Proposal",
data: JSON.stringify({ GetProposal: GetProposal, ProductName: ProductName, ProductID: ProductID }),
contentType: "application/json; charset=utf-8",
dataType: "json",
failure: function (response) {
alert(response.d);
}
});
}
Page.ascx Method for Proposal:
[WebMethod]
public static void Proposal(string GetProposal, string ProductName, string ProductID)
{
HttpContext.Current.Response.Redirect("MyPage");
}
Encountering Error when Posting Ajax to Proposal method:
POST http://localhost:63290/Page.ascx/Proposal 403 (Forbidden)
Need to identify the issue with my code. Any suggestions on what needs to be changed?