same controller in different tab (tabstrip)

3 posts, 0 answers
  1. Roberto
    Roberto avatar
    5 posts
    Member since:
    Mar 2015

    Posted 04 Aug 2015 Link to this post

    Hello,
    I have this problem: using a kendo mvc tabstrip, in each tab load content using LoadContentFrom, loaded different views, but in each of these have included a menu toolbar, using Html.RenderPartial ("~ / Views / Toolbar.cshtml"); .
    The problem is that only in the first tab loaded, the toolbar is visible, the other tab is not visible, and there aren't errors in the console or in the application.
    I think it is a problem related to the fact that the id of the toolbar is the same, but I'm not sure, in any case I would not know how to solve it.
    Someone can you help me?

    Thanks, Marco

  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 06 Aug 2015 Link to this post

    Hello Marco,

    Indeed, this seems to be caused by the identical IDs, which prevents the other toolbars from initializing. You could try passing a unique ID through the PartialView's ViewData and using it to generate the the Toolbar's name. For example: 
    @(Html.Kendo().ToolBar()
        .Name("ToolBar" + ViewData["name"].ToString())


    Regards,
    Alexander Popov
    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. Roberto
    Roberto avatar
    5 posts
    Member since:
    Mar 2015

    Posted 27 Aug 2015 Link to this post

    Thanks for your help, this way works :-)

    Regards

Back to Top