Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 返回两个列表<&燃气轮机;WebMethod中的对象并使用jQueryAjax处理它们 [WebMethod] 公共列表GetStream() { List Streams=Stream.GetRange(0,10,HttpContext.Current.User.Identity.Name); 回流; }_C#_Jquery_Asp.net_Ajax_Json - Fatal编程技术网

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);