2011-11-16 78 views
1
[WebMethod] 
public List<Stream> GetStream() 
{ 
    List<Stream> Streams = Stream.GetRange(0, 10, HttpContext.Current.User.Identity.Name); 
    return Streams; 
} 

我想此相同的方法還包括以下內容:返回兩個List <>從的WebMethod對象和與jQuery AJAX處理它們

List<Comment> Comment = Comment.GetByStreamId(for each stream id 
here of the retrieved streams above); 

我還要兩個列表作爲數組返回它們的List對象,以便它們與jQuery ajax一起使用。

我怎樣才能做到這一點,使用jQuery處理它們返回JSON之後。

對此提出建議?由於

+0

Comment and Stream has same members? –

回答

1

,因爲你需要在一個單獨的列表 返回兩個項目然後定義結構類 讀值逐一添加到列表

公共結構CommentandStream

{

公衆int Item1;

公衆詮釋項目2;

}

相關問題