This is a migrated thread and some comments may be shown as answers.

[Solved] How to use Razor foreach to define pane content?

0 Answers 31 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 09 Feb 2012, 03:40 PM
I can use this Razor code to dynamically create checkboxes

 

<label>Summary</label>@Html.CheckBox("checkBoxSummary", true)

@foreach (MyDetailData detail in @Model.DetailRows){

    <label> @detail.Name</label>@Html.CheckBox("checkBoxDetail" + @detail.Name, true)

}

My question is, how do I use that within my splitter pane content?  I can't figure out the syntax for the foreach statement.

Here is what I am trying to do:


.Panes(innerPanes =>

{

innerPanes.Add()

    .Resizable(true)

    .Size("35px")

    .MinSize("35px")

    .Content(

        @"<table style='width:100%; border-style:none;'>" +

            @"<tr>" +

                @"<td style='border-style:none; text-align:left;'>" +

                    @"<label>Summary</label>" +

                    @Html.CheckBox("checkBoxSummary", true).ToHtmlString() +

                    I WANT TO ADD THE FOREACH HERE

                @"</td>" +

            @"</tr>" +

        @"</table>"

);

Tags
Splitter
Asked by
Kevin
Top achievements
Rank 1
Share this question
or