wcf サービスを使用するクライアント asp.net mvc3 razoc があります。Collection[]「サーバー上のトップコレクション」を返すメソッド GetTopCollections があり、すべてのツリーではなく、このコレクションの最初のレベルのみを返すメソッド GetTreeView(string id) があります。
最初にトップ コレクションを表示したい (完了)。それらのトップ コレクションの 1 つをクリックすると、メソッド GetTreeView(handle) を呼び出してツリーの最初のレベルを表示します。
これは、コントローラーの最初のメソッドです。
public ActionResult GetData()
{
client = new DSServiceClient();
Collection[] _top = new Collection[10];
client.Open();
_top = client.GetTopCollections();
client.Close();
return View(_top);
}
これは GetData のビューです
@model DSClient.Controllers.Collection[]
@{
ViewBag.Title = "GetData";
@Html.ActionLink( @Model.ElementAt(0).Handle,"GetData3","Home",new { handle=@Model.ElementAt(0).Handle });
}
これは GetData2() です
public PartialViewResult GetData2(string handle)
{
client = new DSServiceClient();
Tree tree = new Tree();
tree = client.GetTreeView(handle);
return PartialView("~/Views/Shared/GetData2.cshtml",tree);
}
これが GetData2 のビューです
@model DSClient.Controllers.Tree
@{
ViewBag.Title = "GetData3";
@Model.listObjects.ElementAt(0).Name;
}
そして、これは GetData を呼び出すためのリンクです
@Html.ActionLink("WebService", "GetData", "Home")
GetData3 の結果が他のビューに表示されるのですが、同じビューに表示したいのですが、ツリービューのように。誰か助けてくれませんか?