Home  >  Article  >  Web Front-end  >  jquery post method passes multiple parameter values ​​and receives them in the form of arrays in the background_jquery

jquery post method passes multiple parameter values ​​and receives them in the form of arrays in the background_jquery

WBOY
WBOYOriginal
2016-05-16 17:43:481186browse

When passing multiple values ​​using jquery's post method, the background page can receive

in the form of an array as shown below

Copy the code The code is as follows:



The $.post method does not support passing parameters in the form of arrays, so in the above jquery code, pass it as a string. The aspx page in the background can receive it as an array. Form splitting, the code is as follows
Copy code The code is as follows:

string arr = Request[" arr"].ToString();
string[] myarr = arr.Split(',');
string message = myarr[0];
string name = myarr[1];
string action = myarr[2];
string time = myarr[3];

In this way, the corresponding value can be obtained.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn