读书人

应用$.get()方法调用webservice

发布时间: 2012-11-04 10:42:41 作者: rapoo

使用$.get()方法调用webservice

JScript code
$("#testWS").bind("click", function () {                $.get('WS1.asmx/text', { text: $("#txt").val() }, function (data) {                    alert(1);                    $("#result").html($(data));                });            });


C# code
[WebMethod]        [System.Web.Script.Services.ScriptMethod(UseHttpGet = true)]        public string text(string text)        {            return text;        }


点击按钮后没反应,菜鸟求助!

[解决办法]
你要config中配置的,配置 可以get和post
[解决办法]
要在配置文件中配置,支持post和GET

读书人网 >Web Service

热点推荐