Home > Web Front-end > JS Tutorial > Standard method of passing parameters (jQuery.ajax)_jquery

Standard method of passing parameters (jQuery.ajax)_jquery

WBOY
Release: 2016-05-16 18:58:38
Original
1009 people have browsed it
Front Desk
Copy code The code is as follows:




Untitled page




Click

receive background data

hello




Backend
Copy code The code is as follows:

public partial class ajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Response.Write("hello" Request["name"]);
Hashtable ht = new Hashtable();
ht.Add("name", Request.Params[" name"]);
ht.Add("id", Request.Params["id"]);
Response.Write(CreateJsonParams(ht));
Response.End();
}
private string CreateJsonParams(Hashtable items)
{
string returnStr = "";
foreach (DictionaryEntry item in items)
{
returnStr = """ item.Key .ToString() "":"" item.Value.ToString() "",";
}
return "{" returnStr.Substring(0, returnStr.Length - 1) "}";
}
}

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template