I am trying to call ASP.net 1.1 service in asp.net using Jquery, can't figure put what I am doing wrong here, Pleaseeeee help

Javascript Method

function YesCheckChanged(vSRID) {
    var para = {
        SRID: vSRID
    };

    jQuery.ajax({
        type: "POST",
        url: serviceUrl + "/YesRdoClicked",
        dataType: "xml",
        data: para,
        contentType: "application/xml; charset=utf-8",
        success: function(data, status) {
            alert(data);
            edata = $(data).find("string").text();
            alert(edata);
        },
        error: function(e, status) {

            alert(status);
        }
    });

}​

Error

System.InvalidOperationException: Request format is invalid:
application/xml; charset=utf-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

Service method Code

[WebMethod(true)]       
public string YesRdoClicked(int SRID)
{
    clsEntity obj = new clsEntity();
    obj.New_DeleteTempEntity(SRID);
    return "yes";
}
有帮助吗?

解决方案

http://www.codeproject.com/Articles/1231/ASP-NET-Web-Service

I finally resorted to native Activex calls as no other way seem to work for me. Personally I wanted to avoid using it. But It works well.

A word of caution here, activeX are not very well supported in browsers other than IE so you need to either have IE Only application or convince the client to upgrade to higher version of asp.net.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top