Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > TabStrip > Binding to Model Content doesn't set in Razor
Telerik MVC Extensions are no longer supported (see this page for reference). In case you have inquiries about Kendo UI Complete for ASP.NET MVC, post them in the pertinent Kendo UI forums.

Not answered Binding to Model Content doesn't set in Razor

Feed from this thread
  • Saul avatar

    Posted on Nov 23, 2011 (permalink)

    I have a model with HTML content and I'm trying to bind my Tabstrip to this model and set content but it throws errors. I've tried many different variations of item.Content setting but none of them work. 

    The line:
    item.Content = () => Tab.Content;
    gives an error:
    Only assignment, call, increment, decrement, and new object expressions can be used as a statement

    The line:
    item.Content = Tab.Content;
    gives an error:
    Cannot implicitly convert type 'string' to 'System.Action'


    Is there a way to set content directly and not going to Action?


    Here is my code:



    @{ Html.Telerik().TabStrip()
            .Name("TabStrip")
            .SelectedIndex(0)
            .BindTo(Model, (item, Tab) =>
            {
                item.Text = Tab.Name;
                item.Content = Tab.Content;


            })
            .Render();




    public class Tab : BaseMenu
        {
            public string Name { get; set; }
            public string Content { get; set; }


        }


Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > TabStrip > Binding to Model Content doesn't set in Razor
Related resources for "Binding to Model Content doesn't set in Razor"

ASP.NET MVC TabStrip Features  |  Documentation  |  Demos  |  Telerik TV ]