在我的objectdatasource中,我正在使用_selected事件從列表中獲取某個對象返回的值。所以我使用e.Returnvalue
。將自定義列表值複製到var或dynamic並循環遍歷?
protected void ObjTrailerList_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
dynamic details = e.ReturnValue;
var d = e.ReturnValue;}
現在我想複製整個自定義列表值VAR或動態ñ遍歷。 怎麼辦?我不想創建MovieTrailer對象列表並複製其中的值。
我的自定義列表是
public class MovieTrailers
{
public int? TrailerId
{
get;
set;
}
public string MovieName
{
get;
set;
}
public string TrailerUrl
{
get;
set;
}
}
爲什麼-1票????我問什麼錯誤的東西? –
你沒有給出足夠的細節,或向我們展示你想要做什麼。解決這個問題,也許最後的選票將停止。 –
哦...我試過給了我錯誤,所以我沒有發佈代碼。我可以選擇創建我不想要的List。我會發布我正在嘗試。我發佈如何複製到var或dymaic ..現在我不知道如何遍歷它們。 –