Front Desk
Untitled page Click
receive background data
hello
Backend
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) "}";
}
}
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