Page 1 of 1

Pass null value using ajax

Posted: Sun May 10, 2009 10:27 pm
by cohq82
Hi,

I wonder if there is a way to pass a null value through ajax. For example in the code below, sometime the toMessageId is not used but the server side requires it. Is there a way to pass something like this "toMessageId: null"? I tried and that didn't work. The way I do it now is to pass "0" value instead but that is not right. If I don't pass anything, it pops error. Please let me know. Thanks

Code: Select all

 
      $.ajax(
        {
          type: "POST",
          async: false,
          url: "/Status/AddNewMessage",
          data: {
            message: msg,
            toMessageId: 0,
            sendBy: 'sendername'
          },
          success: function(html) {
            alert("good to go");
          },
          error: function(error) {
            alert(error);
          }
        });
    }
 

Re: Pass null value using ajax

Posted: Sun May 10, 2009 10:49 pm
by cohq82
never mind.. it was the server issue.