MobileDrawer MVC helper error with no views

4 posts, 1 answers
  1. Bil
    Bil avatar
    27 posts
    Member since:
    Aug 2012

    Posted 27 Feb 2015 Link to this post

    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
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 03 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Bil
    Bil avatar
    27 posts
    Member since:
    Aug 2012

    Posted 05 Mar 2015 in reply to Petyo Link to this post

    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?
  5. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 09 Mar 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready