Configure ASP.NET menu management as a mega drop-down menu

Platform:
Designing a website on ASP.NET 4.0 (Webforms) using C #.

Situation:
My processed ASP.NET control is horizontal and has three levels of data. And I set StaticDisplayLevels = "1" so that the menu displays level1 data horizontally and defaults to level1, the menu displays level2 data and onmouseover level2, the menu displays level 3 data.

Demand:
To display level 2 and level 3 data in one list, children of the first level2 (if any) are displayed below the data of the first level2. Then comes the second level2 and his children (if any) and so on.

Want a display like the first one. ASP.NET Menu control displays something like second Consider the above image. What I would like to have is a display similar to the one on the left. But the ASP.NET Menu control displays it as an image on the right side.

I searched high and low on the net for a solution. I even tried replacing the markup of the generated asp.net control with the Menu DataBound event, and then inject a javascript hack into it . I succeeded, but it does not have the possibility of reuse.

What I would like to have is a way to implement a re-managed ASP.NET control with static level2 (and level3) after dynamic level1, which acts like megadropdown. I am sure that there must be a way and that I am going wrong. Any ideas?

+4
source share
2 answers

It is impossible to get simple solutions.

The workaround was that a hierarchical site map was placed in a table with a parent identifier for the parent xml and 0 if there was no parent. Then I programmatically created asp: A menu in the code behind this data

0
source

You must set the menudisplaylevel level in the menu control to 3. Please check this.

MaximumDynamicDisplayLevels="3" <asp:Menu ID="Menu1" runat="server" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="3" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" OnDataBound="Menu1_DataBound"> </asp:Menu> 
0
source

Source: https://habr.com/ru/post/1341582/


All Articles