views:

21

answers:

1

I want to send a string data with jquery load function but its not sending, my code is

 function dialog(data) {
            $(function () {
                alert(data);
                var ph = $("#Org1");
                ph.empty();
                ph.load("/FrontEnd/DocsDownload", data, function () {
                    ph.dialog({
                        width: 500,
                        modal: true,
                        show: 'slide',
                        closeText: 'hide',
                        draggable: false,
                        resizable: false,
                        title: "Download"
                    });
                });
            });
        }

alert show me the data but when it goes to that controller and i pick value from data variable it have null value. My controller code is

public ActionResult DocsDownload(string data)
{
}

what may be the problem?

+2  A: 

The data parameter is a name/value pair:

.load('/FrontEnd/DocsDownload', { data: 'Hello World' }, function () { 

And send multiple parameters:

.load('/FrontEnd/DocsDownload', { param1: 'value1', param2: 'value2' }, function () { 
Darin Dimitrov
Thanks Darin it works
Fraz Sundal