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

[Solved] Menu loads slow - binding to sitemap

4 Answers 35 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank Saraceno
Top achievements
Rank 1
Frank Saraceno asked on 20 Feb 2011, 04:21 PM
In the Telerick MVC source code, In Menu.cs, I'm noticing a problem with a Menu that is 
bound to a sitemap, the menu is loading slowing, taking about 5-10 seconds.
This is how I use menu in the view - pretty basic.

<%: Html.Telerik().Menu()      
                      .Name("Menu")       
                      .BindTo("sample")%>


In debugger I've isolated the problem to following line of code to where it hangs.

In the Telerick MVC source code, menu.cs, the WriteHtml function hangs for
about 5-10 seconds before menu appears. The line of code that hangs is
Items.Each(item => item.WriteItem<MenuMenuItem>(this, menuTag, builder));











In Menu.cs this is the method...










protected override void WriteHtml(HtmlTextWriter writer)
        {
            
Guard.IsNotNull(writer, "writer");

            if (Items.Any())
            {
                if (SelectedIndex != -1 && Items.Count < SelectedIndex)
                {
                    throw new 
ArgumentOutOfRangeException(TextResource.IndexOutOfRange);
                }

                if (HighlightPath)
                {
                    Items.Each(HighlightSelectedItem);
                }

                
INavigationComponentHtmlBuilder<MenuItem> builder = rendererFactory.Create(this);

                
IHtmlNode menuTag = builder.Build();

                Items.Each(item => item.WriteItem<
MenuMenuItem>(this, menuTag, builder));

                menuTag.WriteTo(writer);
            }
            
            base.WriteHtml(writer);
        }







Anyone else run into this?



4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 21 Feb 2011, 08:23 AM
Hi Frank Saraceno,

 This is not a known issue and I cannot reproduce it in our online demo where the menu appears instantly. We will need a sample project which demonstrates the slow loading. You can attach one to this thread.

Regards,
Atanas Korchev
the Telerik team
0
Frank Saraceno
Top achievements
Rank 1
answered on 22 Feb 2011, 04:09 AM
Hi,

Thanks for the reply. Yes the menu in example code works fine. Unfortunately, I have a real world application
that is too big (and proprietary) to send to you. I'll have to find solution on my own. I'll re-post once I find the solution.

Thanks again.
0
Badi
Top achievements
Rank 1
answered on 30 Apr 2013, 07:00 AM
How did you end up solving this problem. I am experiencing the same problem with my MVC application that uses Telerik().Menu() ?
0
Badi
Top achievements
Rank 1
answered on 30 Apr 2013, 07:00 AM
How did you end up solving this problem. I am experiencing the same problem with my MVC application that uses Telerik().Menu() ?
Tags
Menu
Asked by
Frank Saraceno
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Frank Saraceno
Top achievements
Rank 1
Badi
Top achievements
Rank 1
Share this question
or