This question is locked. New answers and comments are not allowed.
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:
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; }
}
.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; }
}