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

Sitemap binding

1 Answer 210 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Chris asked on 09 Apr 2019, 12:33 PM

Hi,

Sorry for a daft question. I am using VS2019, ASP.net Core 2.2, UI for ASP.net Core 2019.1.220. I am trying to bind a site map to the menu as I need security trimming, either using the Html helper or the tag helper. The issue is I am trying to follow  this page: https://docs.telerik.com/aspnet-core/html-helpers/navigation/menu/binding/sitemap-binding 

For the life of me I cannot find a reference SiteMapManager (Step 3) anywhere, have been Googling my fingers to the bone and still can't find anything! Also The example shows the call to populate in a controller, seems an odd place to put it or is the idea that the menu is only populated for example on the first call to the Home Index ?

 

Thanks

 

Chris

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 12 Apr 2019, 10:25 AM
Hello Chris,

Please, excuse us for misleading you with the documentation article in question. That article should not be present in the Telerik UI for ASP.NET Core documentation as the Menu HTML / Tag helper does not offer support for Sitemap binding. The article is applicable only for the ASP.NET MVC suite.

Having that said, the .Net Core Menu does not provide the means, required to be bound to a Sitemap file. What you could do in this case would be to read the SItemap file on the server and map it to a list of objects. You could follow an approach similar to the suggested in this StackOverflow thread. Then you could pass the generated list to the helper and bind it using the BindTo() configuration call.

As a small token of gratitude for bringing this issue to our attention, I have updated your Telerik points.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Monesh
Top achievements
Rank 1
commented on 10 Jan 2024, 09:44 AM | edited

hi,
i'm using telerik RadSiteMap to show some radtree data as navigation path. i have wrote the server side code and everthing in the server side working fine like getting node path from radtree which resides in another aspx page, getting node values and adding it to RadSiteMap object named radsitemap. i have checked by debugging radsitemap is storing the node values but it is not binding it to the front end code.

below is my front end code 

 <telerik:RadSiteMap ID="mySiteMap" runat="server" Enabled="true" ViewStateMode="Enabled"  Visible="true">
        <DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" Layout="Flow">
            <SeparatorTemplate>
                <asp:Label ID="labelSeparator" runat="server" Text=">>" Font-Bold="true" Font-Size="Large"></asp:Label>
            </SeparatorTemplate>
        </DefaultLevelSettings>
     <LevelSettings>
           <telerik:SiteMapLevelSetting Level="0" MaximumNodes="4">
            </telerik:SiteMapLevelSetting>
     </LevelSettings>
    </telerik:RadSiteMap>
     <asp:Label ID="lblError" runat="server" Text="Unable to load site map." Visible="false" ViewStateMode="Disabled"
        ForeColor="Red">
    </asp:Label>


(note: i have used ajax in radtree page to update the tree)
Attila Antal
Telerik team
commented on 12 Jan 2024, 09:38 AM

Hi Monesh,

This question was submitted in the wrong Forum section. Please submit the question in the Telerik UI for ASP.NET AJAX (https://www.telerik.com/forums/aspnet-ajax?tagId=1350) and also show us which instructions you are following to bind data to the SiteMap.

Tags
Menu
Asked by
Chris
Top achievements
Rank 2
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or