62,047
社区成员
发帖
与我相关
我的任务
分享
[WebMethod]
public string sendform()
{
string name= HttpContext.Current.Request["name"];
return name
}
public string sendform()
{
NameValueCollection nvcGet = HttpContext.Current.Request.QueryString;//这里可以取所有get过来的值
NameValueCollection nvcPost = HttpContext.Current.Request.Form;//这里可以取所有post过来的值
string name=//从nvc的键值对里面去name的值;
return name
}
试试 [WebMethod]
public string sendform(string Json)
{
//ToDo
return name;
}
把表单的数据转成一个Json对象,直接传过去
[WebMethod]
public string sendform(NameValueCollection nvcGet)
{
string name= HttpContext.Current.Request["name"];
return name
}
NameValueCollection nvcGet = HttpContext.Current.Request.QueryString;//这里可以取所有get过来的值
NameValueCollection nvcPost = HttpContext.Current.Request.Form;//这里可以取所有post过来的值
把所有的值放在键值对立面就好了