2
请求URL的一个例子:http:\\localhost\ChatWindow.aspx?username=sly_chandan
无法检索查询字符串参数。
我的WebMethod如下表所示:
[WebMethod(EnableSession = true)]
public static List<PrivateMessage> GetMessages()
{
List<PrivateMessage> getMsgsList = (List<PrivateMessage>)HttpContext.Current.Application["PrivateMessages"];
var msgs = getMsgsList.Where(x => x.fromUsername == HttpContext.Current.Session["Username"].ToString() && x.toUsername == HttpContext.Current.Request.QueryString["username"]);
return msgs.ToList();
}
我似乎无法检索查询参数。
也许你的意思||代替 && – onof