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();
}
.
[WebMethod(EnableSession = true)]
public static List<PrivateMessage> GetMessages(string username)
{
List<PrivateMessage> getMsgsList = (List<PrivateMessage>)HttpContext.Current.Application["PrivateMessages"];
var msgs = getMsgsList.Where(x => x.fromUsername == HttpContext.Current.Session["Username"].ToString() && x.toUsername == username;
return msgs.ToList();
}
어쩌면 당신이 || 의미 : – onof