Built-in markup blocks (@ <p> Content </p>) cannot be nested. Only one level of inline markup allowed
Hi, I am getting an error:
Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed. Using the Kendo UI and MultiSelectBoxes Tabs with Razor and MVC4 View
I tried to implement a helper class, but I still get the error
Here is my code, did I skip a step? I moved 3 multi-outputs and called them an assistant!
@(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); }) ) } +8
KeyboardFriendly
source share1 answer
I get it.
I need to tie up assistants.
So, one helper class for each of the multi-select.
Follow this: http://www.aspnetwiki.com/telerik-mvc:nested-container-controls-and-razor-helper
Then, if you need several MultiSelects In One Tab, you will need to have an assistant for each multi selector, for example:
Here is an assistant, 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 contents of the TabStrip as follows:
.Items(tabstrip => { tabstrip.Add().Text("One") .Content(@<text> @RenderMultiSelectFirstBox() @RenderMultiSelectSecondBox()</text>); +11
KeyboardFriendly
source share