3

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?

1 Answer 1

8

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 () { 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.