开发者

HttpContext.Request.Form has value, null when assigned to variable

I am at a loss. We have a class that handles callbacks from client-side actions

jQuery开发者_如何学Python.ajax({data: data, error: null, success: null, type: "POST", dataType: 'json', url: "/mylogger.axd"});. 

I assign HttpContext.Request.Form to a variable. Though it is non-null, and has all the parameters I expect, the variable I assigned it to is null.

public class MyLogger : IHttpHandler, IRequiresSessionState
{
    public void ProcessRequest(HttpContext context)
    {
        NameValueCollection formParams = context.Request.Form;

        if (formParams == null)
        { ...

If I attach Visual Studio to the process, when this gets fired, context.Request.Form definitely has a value:

{response=http%3a%2f%2fXXX.XXXcom%2fproduct%2f12345%2f13528311&event=MYEVENT&objid=13528311&objtype=2}  System.Collections.Specialized.NameObjectCollectionBase {System.Web.HttpValueCollection} 

And yet, formParams is null.

Huh? In general, is there any reason why the value wouldn't be copied into the variable?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜