Front Desk
Untitled page Click
Receive background data
hello
Backstage
protected void Page_Load(object sender, EventArgs e)
{
Hashtable ht = new Hashtable();
string name = Request.Params["name"].ToString();
string birth = Request.Params["birthday"].ToString();
if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(birth))
{
//Response.ContentType = "Application/json";
//Response.Write(CreareJson("this is ok!", 1, name, birth));
ht.Add("info", "Successful");
ht.Add("sta", "status");
ht.Add("name", name) ;
ht.Add("birth", birth);
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) "}";
}