“消息”:“无效的Web服务调用,参数的缺失值:\ u0027message \ u0027。”,“StackTrace”:" [英] "Message":"Invalid web service call, missing value for parameter: \u0027message\u0027.","StackTrace":"

查看:102
本文介绍了“消息”:“无效的Web服务调用,参数的缺失值:\ u0027message \ u0027。”,“StackTrace”:"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用$ .ajax()调用服务器端方法并使用Json格式传递值,但我收到此错误:

I''m trying to call the server side method and passing value with Json format using $.ajax() ,but I got this error:

"Message":"Invalid web service call, missing value for parameter: \u0027message\u0027.","StackTrace":" 



我将非常感谢您的帮助。

客户端代码:


I would appreciate for your help.
client side code:

$(''#submit_form'').click(function () {
               if ($(''#feedback_text'').val() != '''') {
               var values = { feedback : $("#feedback_text").val()};
                   $.ajax({
                       type: "POST",
                       url: "test2.aspx/ReceiveFeedback",
                       data: JSON.stringify(values),
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       processData: false ,
                       success: function (data) {
                          alert(data);
                       }
                   });
               }
           });



服务器端代码:


server side code:

[WebMethod]
   [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
   public static string ReceiveFeedback(string message)
   {
       string msg = "Thanks for your feedback";
       return msg;
   }

推荐答案

.ajax(),但我收到此错误:

.ajax() ,but I got this error:
"Message":"Invalid web service call, missing value for parameter: \u0027message\u0027.","StackTrace":" 



我会感谢您的帮助。

客户端代码:


I would appreciate for your help.
client side code:


(''#submit_form'') .click(function(){
if(
(''#submit_form'').click(function () { if (


(''#feedback_text'')。val()!=''''){
var values = {feedback:
(''#feedback_text'').val() != '''') { var values = { feedback :


这篇关于“消息”:“无效的Web服务调用,参数的缺失值:\ u0027message \ u0027。”,“StackTrace”:"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆