Tabstrip ClientDetail template Invalid template

4 posts, 0 answers
  1. reynaldo
    reynaldo avatar
    2 posts
    Member since:
    May 2013

    Posted 05 Jun 2013 Link to this post

    Im having a problem rendering a detail template which is compose of Kendo Tabstrip. It generates an "Invalid Template" error. Below is my code

    @(Html.Kendo().Grid<OrderInfo>()
        .Name("grid")
        .Columns(columns =>
        {
            columns.Bound(e => e.OrderID);
            columns.Bound(e => e.MaterialID);
        })
        .Sortable()
        .Pageable()
        .Scrollable()
        .ClientDetailTemplateId("drawingtemplate")
        .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("ReadOrders","Admin"))
           )
       .Events(events => events.DataBound("dataBound"))
     )
    <script>
        function dataBound() {
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        }
    </script>
    <script id="drawingtemplate" type="text/kendo-tmpl">   
        @(Html.Kendo().TabStrip()
            .Name("my#=OrderID#")
            .SelectedIndex(0)
            .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))        
            .Items(items =>
              {
                  items.Add().Text("FirstTab")
                      .Selected(true)
                      .Content("try");
              })
              .ToClientTemplate()       
              )
    @(Html.Kendo().NumericTextBox<double>()
                .Name("my#=OrderID#")
                .Format("p0")
                .Min(0)
                .Max(0.9)
                .Step(0.01)
                .Value(0.05)
                .ToClientTemplate()
            )
    </script>
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 07 Jun 2013 Link to this post

    Hi Reynaldo,


    The provided code seems correct. The only issue that I found, which is not related to the template error is that the two widgets TabStrip and NumericTextBox will have identical names, so please rename one of them.

    I am assuming that the error is caused by the AntiXss encoder. Please remove the following line from your Web.config file if it is present.

    E.g.
    <httpRuntime targetFramework="4.5" encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

     
    I hope that this information was helpful for you. I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. reynaldo
    reynaldo avatar
    2 posts
    Member since:
    May 2013

    Posted 10 Jun 2013 Link to this post

    hi dimiter,

             the numeric textbox was originally commented out, it is really included in the code.

             when i deleted the line in the web config it produces another error in the code produce by the kendo like the following

    e=kendo.htmlEncode;with(data){o='<tr class="k-detail-row"><td class="k-hierarchy-cell"></td><td class="k-detail-cell" colspan="5">'+(this.tmpl0(data))+'</td></tr>';}return o;
    the error is:
    Object expected

    If there is a handler for this exception, the program may be safely continued
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 11 Jun 2013 Link to this post

    Hi Reynaldo,


    This is a very generic JavaScript error and I could not be sure what exactly is causing the issue. If it is convenient, could you please send me a sample runnable project, which I could inspect locally and assist you further?

    I am looking forward to hearing from you.

     

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready