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

Multiple EditorFor

1 Answer 195 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Janko
Top achievements
Rank 1
Janko asked on 28 May 2014, 11:20 AM
Hi,

i have problems with multiple editors on the same page:

01.@model IEnumerable<SampleViewModel>
02. [...]
03.@foreach (var item in Model)
04.{
05. <div class="form-horizontal">
06.        <div class="form-group">
07.            @Html.LabelFor(modelItem => item.Html, new { @class = "control-label col-md-2" })
08.            <div class="col-md-10">
09.                @Html.Kendo().EditorFor(modelItem => item.Html).Tools(tools=>tools.ViewHtml()).Encode(false)
10.            </div>
11.        </div>
12.    </div>
13.} [...]

I know that each editor needs a unique name, but than a post to the controller with the correct model doesn't work... what is the best practice here?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 29 May 2014, 11:18 AM
Hello Janko,

You can use the HtmlAttributes fluent API to set the editor id attribute without affecting the textarea name attribute.

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Janko
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or