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

[Solved] Splitter

3 Answers 40 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.
Iwhp
Top achievements
Rank 1
Iwhp asked on 10 Nov 2011, 08:53 AM
I do have the following Spliter Content defined:
.Content(@<text>
    @{ 
        <div>
            <table>
                @foreach (KeyFigure item in Model.KeyFigures)
                {
                    <tr>
                        <td>
                            @Html.DisplayTextFor(m => item.Name)
                        </td>
                        <td>
                            @Html.TextBox("xxx")
                        </td>
                    </tr>
                }
            </table>
        </div>}
    </text>)

The problem is, that @foreach and @Html.DisplayText / @Html.TextBox seems to make problems.
There is no ouptut produced.
Any hints?
Thankx, Harry

PS: Telerik Team: please rename the subject to: Splitter content @foreach @Html.xxx trouble

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 10 Nov 2011, 10:37 AM
Hello Harry,

Is the outer code block necessary? Does the following work for you:

.Content(@<div>
            <table>
                @foreach (KeyFigure item in Model.KeyFigures)
                {
                    <tr>
                        <td>
                            @Html.DisplayTextFor(m => item.Name)
                        </td>
                        <td>
                            @Html.TextBox("xxx")
                        </td>
                    </tr>
                }
            </table>
        </div>)


Kind regards,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Iwhp
Top achievements
Rank 1
answered on 10 Nov 2011, 11:55 AM
Thankx Alex!
No this does not work, I get the following error:

CS1593: Delegate 'System.Action' does not take 1 arguments

Any other ideas?
Cheers Harry
0
Iwhp
Top achievements
Rank 1
answered on 10 Nov 2011, 12:22 PM
This is how it works. The problem was, that item was used elsewere (don't no exactly were so...).
.Content(@<text><div>
                <table>
                    @foreach (KeyFigure keyFigure in Model.KeyFigures)
                    {
                        <tr>
                            <td>
                                @(Html.DisplayTextFor(m => keyFigure.Name))
                            </td>
                            <td>
                                @(Html.TextBox("xxx"))
                            </td>
                        </tr>
                    }
                </table>
            </div></text>)

Thankx, Cheers Harry
Tags
Splitter
Asked by
Iwhp
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Iwhp
Top achievements
Rank 1
Share this question
or