Hello I am getting the error:
Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed.
Using a Kendo UI tabstrip and MultiSelectBoxes with a Razor View and MVC4
I have tried implementing the helper class, but I am still getting the error
Here is my code, am I missing a step? I moved the 3 multiselects out and called them with the helper!
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(tabstrip =>
{
tabstrip.Add().Text("One")
.Content(@<div>
@RenderSelect()
</div>;);
tabstrip.Add().Text("Two")
.Content("Two");
tabstrip.Add().Text("Three")
.Content("Three");
})
.SelectedIndex(0)
)
@helper RenderSelect()
{
<h2>MyList</h2>
<label>One</label>
@(Html.Kendo()
.MultiSelect()
.Name("One")
.AutoBind(true)
.Placeholder("Select Clients...")
.DataTextField("hname")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("Client", "Dist");
})
.ServerFiltering(true);
})
)
<label>Two</label>
@(Html.Kendo()
.MultiSelect()
.Name("Two")
.AutoBind(true)
.DataTextField("gname")
.Placeholder("Select Recipients...")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("Client", "Dist");
})
.ServerFiltering(true);
})
)
<label>Three</label>
@(Html.Kendo()
.MultiSelect()
.Name("Three")
.AutoBind(true)
.DataTextField("id")
.Placeholder("Select CLL...")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("Codes", "Dist");
})
.ServerFiltering(true);
})
)
}
I figured it out.
I have to chain the helpers.
So One helper class for each of the multi-selects.
Follow This: http://www.aspnetwiki.com/telerik-mvc:nested-container-controls-and-razor-helper
Then If you want multiple MultiSelects In One Tab You will need to have a helper for each multiselect like this:
Here is the helper, just copy this for the second third and fourth and change the names etc...
@helper RenderMultiFirstBox()
{
@(Html.Kendo()
.MultiSelect()
.Name("First")
.AutoBind(true)
.Placeholder("Select First...")
.DataTextField("name")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("Index", "Something");
})
.ServerFiltering(true);
})
)
}
Then Call the helpers in the TabStrip 'Content' like this:
.Items(tabstrip =>
{
tabstrip.Add().Text("One")
.Content(@<text>
@RenderMultiSelectFirstBox()
@RenderMultiSelectSecondBox()</text>);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With