javascript - Not Building jQuery ajax data correctly -
I have the following JS code in Aspx page:
$ .ajax ({type: 'post', url: '/ reporting / landing.aspx / update user reporting settings', data : "{'Reporting Settings':" + Columns Include () + "'}", Content Type: "Application / Jason; Charset = UTF-8", Data Type: "Jason", before: Function , Opts) {}, success: function (data) {window.top.location.href = "landing.aspx";}, error: function (excerpt, AjaxOptions, thrownError) {warning ('error Word '+ thrownError;) warning (' error '+ xhr.responseText);}}); Columns have been created above like this:
$ ('# currentColumnsList'). Each (function () {// it is internal scope, .phrase element var column = ''; $ (this) .find ('li') in context. Each (function () {// cache jquery var var current = $ (This); // Check our current children (Sub Elements) // If this happens, leave it / ps, you can work with the first child / with an empty space UL and make your custom blanket text strangely (current our current phrase column + = (current.text () + ',');}); // now Add our current phrase to the current text (); () is completely created so that we add it to our outer array column. Push (Column);}); I There is a web method on the code behind the page:
[WebMethod] Public static Zero UpdateUserReportingSettings {string columns = reportingSettings; // more code} < / Pre> If I change the data line below, then I hit a breakpoint in webmath. The test will be done as expected in the reporting string:
data: "{'reportingSettings': 'test'}", If I I warn. Join () - I get some row columns, columns A, column B, etc. separated by commas - what is the best way to get the code of WebMethod in the reporting string?
It should be:
Data: "{'Reporting Settings':'" + Column Include () + "'}"
Comments
Post a Comment