Submit array param with jQuery ajax/load

后端 未结 4 1781
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 10:05

public ActionResult DoSomething(string[] arr, bool someBool, int someInt) { }

trying to call the above method from jQuery:

var test = [];
te         


        
4条回答
  •  别跟我提以往
    2021-02-13 10:37

    Even i was facing error, in passing array from HTML page to aspx page.

    my requirement was to load the aspx page in a DIV tag of the html page. on the page load i need to pass these JS array values to aspx page load.

    i used below method.

    $('#').load("Targetpage.aspx",{"Arr":JSArrValues});

    In aspx page load event i can access this values as:

    string results = Response["Arr[]"];

    Thanks to JQuery API documentation enter link description here and stackoverflow

提交回复
热议问题