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

Loading partial view on menu item click

3 Answers 306 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Shabtai
Top achievements
Rank 1
Shabtai asked on 19 Dec 2012, 05:56 PM
Hello, 
I'm using Kendo Menu

<script>
function onSelected(e) { }
</script>
        <div class="k-rtl" >
            <%= Html.Kendo().Menu()
                .Name("Menu").Events(ev=>ev.Select("onSelected"))
                .Items(items =>
                {
                    items.Add()
                         .Text("menu1")
                         .Items(children =>
                         {
                             children.Add().Text("Sub Item 1");
                             children.Add().Text("Sub Item 2");
                             children.Add().Text("Sub Item 3");
                             children.Add().Text("Sub Item 4");
                             children.Add().Text("Sub Item 5");
                         });

                    items.Add()
                        .Text("menu2")
                        .Items(children =>
                        {
                            children.Add().Text("Sub Item 1");
                            children.Add().Text("Sub Item 2");
                            children.Add().Text("Sub Item 3");
                            children.Add().Text("Sub Item 4");
                            children.Add().Text("Sub Item 5");
                        });

                })
            %>
        </div>
        <div id="contentFrame">
                 <%--<% Html.RenderPartial("~/Views/Ascx/WizardControl.ascx"); %>--%>
        </div>

The view is under master page
I need to load partial view (ascx) dynamically into the div (contentFrame) depending on the selected menu item.

How can I perform this?

Thank you in advance
Shabby

3 Answers, 1 is accepted

Sort by
0
Accepted
Holger
Top achievements
Rank 1
answered on 20 Dec 2012, 01:03 PM
Hi,

I have created a small demo project that shows how to load partial views via menu.

Hope this helps,
Holger
0
Shabtai
Top achievements
Rank 1
answered on 20 Dec 2012, 03:33 PM
Thank you very much!

Do you have server-side solution when creating menu in razor as well? (Against JS solution)
0
Holger
Top achievements
Rank 1
answered on 20 Dec 2012, 07:57 PM
>Do you have server-side solution when creating menu in razor as well? (Against JS solution)
Unfortunately not, we are not using server side MVC wrappers.

After a year of using server side MVC extensions (from another vendor) we decided to change to a full client side (JavaScript) library.
Tags
Menu
Asked by
Shabtai
Top achievements
Rank 1
Answers by
Holger
Top achievements
Rank 1
Shabtai
Top achievements
Rank 1
Share this question
or