This is a migrated thread and some comments may be shown as answers.

treeview bind trouble

0 Answers 109 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Don
Top achievements
Rank 1
Don asked on 09 Jun 2010, 08:38 PM
I have something similar to the sample but it is not working,

view

Html.Telerik().TreeView()

.Name(

 

"TreeView")

 

 

.BindTo(

 

"sample")

Controller

[PopulateSiteMap(SiteMapName = "sample", ViewDataKey = "sample")]

 

 

 

public ActionResult SiteMapBinding()

 

{

 

 

if (!SiteMapManager.SiteMaps.ContainsKey("sample"))

 

{

 

 

SiteMapManager.SiteMaps.Register<XmlSiteMap>("sample", sitmap => sitmap.LoadFrom("~/sample.sitemap"));

 

}

 

 

return View();

}

 




I put a breakpoint in the controller and it never got there.
I get an error from the view in it tells me there is no sample.
{"You must have SiteMap defined with key \"sample\" in ViewData dictionary."}
what am i missing

 

Tags
TreeView
Asked by
Don
Top achievements
Rank 1
Share this question
or