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

MobileDrawer MVC helper error with no views

3 Answers 74 Views
Drawer (Mobile)
This is a migrated thread and some comments may be shown as answers.
Bil
Top achievements
Rank 1
Bil asked on 27 Feb 2015, 06:46 PM
In the documentation it says if the views of a mobiledrawer is omitted then the drawer will work on all views.

I have a MobileDrawer setup on my _Layout.cshtml like so:

@(Html.Kendo().MobileDrawer()
    .Name("main-menu")
    .HtmlAttributes(new { style = "width: 210px" })
    .Title("Mobile App")
    .Views("Index")
    .Content(obj =>
Html.Kendo().MobileListView()
    .Items(root =>
    {
        root.AddLink().Icon("inbox").Url("Index", "Outage").Text("Report New Outage");
root.AddLink().Icon("inbox").Url("About", "Home").Text("About");
    })
    )
    )


However if I remove the Views() method I get an null exception? I expected it to just work on any page.

Thanks

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 03 Mar 2015, 11:45 AM
Hi,

this seems strange - the Views is not a mandatory option, indeed. Can you post some more details about the exception? A test case would also help; thank you in advance. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bil
Top achievements
Rank 1
answered on 05 Mar 2015, 12:25 PM
Petyo, using Kirils example from this page:

http://www.telerik.com/forums/using-the-mobile-drawer-in-_layout-in-mvc

Simply remove line 168 from _Layout.cshtl (the .Views one) and you get the null reference error.

Is there a work around for this?
0
Accepted
Kiril Nikolov
Telerik team
answered on 09 Mar 2015, 08:06 AM

Hello Bil,

This issue should already been fixed in the latest internal builds. Please upgrade and let us know if the problem persists.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Drawer (Mobile)
Asked by
Bil
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Bil
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or