-1

I am posting(cross-page) a variable from my javascript function using

$.post("detail.aspx",{data:"mesage"});

It hits the detail page. However I don't know to retrieve the posted value. As its not a form field I could not get it in Request.Form Collection. Any help on this?

Muthukumar Palaniappan
  • 1,622
  • 5
  • 25
  • 49

1 Answers1

0

do ajax call like this,

$.ajax({
        type : 'POST',
        url : 'yourController/Action',
        contentType : "application/json; charset=utf-8",
        dataType : 'json',
        data : param,
        async : false,
        cache: false,
        success : function(dataList) {
            //alert("dataList ---> "+dataList); 
            // work with your returned data in ajax call




        },

        error : function(XMLHttpRequest, textStatus, errorThrown) {
            //alert(XMLHttpRequest + " - " + errorThrown);
        }
    });

you will get returned data in dataList object, do your required operation over there.

Sumit Chourasia
  • 2,394
  • 7
  • 30
  • 57