passing json string as parameter to webmethod

后端 未结 4 689
野性不改
野性不改 2021-01-21 00:29

I\'m making an ajax post to a webmethod EmailFormRequestHandler, I can see on the client side (through firebug) that status of the request is 200 but it\'s not hit

4条回答
  •  天涯浪人
    2021-01-21 01:25

    May be this code helps someone:

    public Dictionary JsonToDictionary(dynamic request)
    {
    JObject x = JObject.FromObject(request);
    Dictionary result = new Dictionary();
    
    foreach (JProperty prop in (JContainer)x)
        { 
           result.Add(prop.Name, prop.Value);
        }
    
    return result;
    }
    

    I use it while debuging when frontend comes first.

提交回复
热议问题