1

I am trying to read the POST Parameters of Sencha Touch 2 in Aspx Page.

And the Aspx is Called by the following way from Sencha Touch Framework(By Mobile Application Team).

Ext.Ajax.request({

          url:'http://bookingsite.com/flight/Secure_Payment.aspx',
          method:'POST',
          disableCaching: false,
          headers: {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
          },
          jsonData: {
          uniqueID:"24608b55-3f69-4814-9de3-ebc88fa95700",
          totalFare:"3500"
          },
          success:function(response)
          {
          console.log(response.responseText);
          }
          failure:function(response)
          {
           console.log(response);
          }});    

The POST parameters of Sencha Touch is read by the following way in Asp.net(Secure_Payment.aspx)

  protected void Page_Load(object sender, EventArgs e)
{
    // Tried by the following ways.

     string uniID = HttpContext.Current.Request.Form["uniqueID"]; 
     string uniID = HttpContext.Current.Request["uniqueID"];
     string uniID = HttpContext.Current.Request.Form.Get("uniqueID");

     if (!string.IsNullOrEmpty(uniID))
        {
            ds = balLayer.GetEBSPaymentParams("uniID");
        }

       tripID=ds.Rows[0]["TripID"].ToString();
       name = ds.Rows[0]["ContactFname"].ToString();
}

Here, the Data set always returns null value.

Please inform me how to read the POST parameters in Aspx page.

Thiri
  • 211
  • 1
  • 3
  • 11
  • 1
    You have to deserialize the Request.InputStream. Please see http://stackoverflow.com/questions/3398926/how-to-retrieve-json-via-asp-net-context-request – sjkm Jun 04 '13 at 06:26

1 Answers1

0

Try with the params property instead of jsonData:

Ext.Ajax.request({
    ...
    params: {
        uniqueID:"24608b55-3f69-4814-9de3-ebc88fa95700",
        totalFare:"3500"
    },
    ...

http://docs.sencha.com/touch/2.2.1/#!/api/Ext.Ajax

Nico Grunfeld
  • 1,133
  • 1
  • 8
  • 19