C# 返回两个列表<&燃气轮机;WebMethod中的对象并使用jQueryAjax处理它们 [WebMethod] 公共列表GetStream() { List Streams=Stream.GetRange(0,10,HttpContext.Current.User.Identity.Name); 回流; }
我希望同样的方法也包括以下内容:C# 返回两个列表<&燃气轮机;WebMethod中的对象并使用jQueryAjax处理它们 [WebMethod] 公共列表GetStream() { List Streams=Stream.GetRange(0,10,HttpContext.Current.User.Identity.Name); 回流; },c#,jquery,asp.net,ajax,json,C#,Jquery,Asp.net,Ajax,Json,我希望同样的方法也包括以下内容: [WebMethod] public List<Stream> GetStream() { List<Stream> Streams = Stream.GetRange(0, 10, HttpContext.Current.User.Identity.Name); return Streams; } List Comment=Comment.GetByStreamId(对于每个流id 这里是上面检索到的流); 我还想将
[WebMethod]
public List<Stream> GetStream()
{
List<Stream> Streams = Stream.GetRange(0, 10, HttpContext.Current.User.Identity.Name);
return Streams;
}
List Comment=Comment.GetByStreamId(对于每个流id
这里是上面检索到的流);
我还想将这两个列表作为列表对象的数组返回,以便使用jQueryAjax使用它们
在返回json后,如何实现这一点并使用jQuery处理它们
建议?谢谢,因为您需要在一个列表中返回这两个项目 然后定义struct类 逐个读取要添加到列表中的值 公共结构CommentandStream { 公共项目1 公共项目2
}因为您需要在一个列表中返回两个项目 然后定义struct类 逐个读取要添加到列表中的值 公共结构CommentandStream { 公共项目1 公共项目2
}评论和流有相同的成员?评论和流有相同的成员吗?
List<Comment> Comment = Comment.GetByStreamId(for each stream id
here of the retrieved streams above);