This works:
@(Html.Infragistics().HtmlEditorFor(p => p.MyHtmlText).ID("MyHtmlText").InputName("MyHtmlText").Render())
But this doesn't:
@(Html.Infragistics().HtmlEditorFor(p => p.Person.Name).ID("Person.Name").InputName("Person.Name").Render())
Is there a way to use the second approach?
Hello Luis,
It does not work because "Person.Name" is passed and accepted as string and cannot be evaluated. Please try to pass it without the quotes:
@(Html.Infragistics().HtmlEditorFor(p => p.Person.Name).ID(Person.Name).InputName(Person.Name).Render())
or maybe Model.Name. Howewer it depends on your configuration if this would work. Please explain what would you like to achieve, and what do you expect Person.Name to return ?
It would be also helpful if you provide more code from your model and controller and I will suggest accordingly.
Thanks Hristo. Your approach is not what I need because that will render a control with an Id and input name equal to the value of Person.Name, say for example that Person.Name == "Luis Enrique" then the controll will have that Id and input name, i.e. "Luis Enrique", worse: that can be a problem if Person.Name is equal to "". What I pretend is to set Id and input name literally called "Person.Name", this is not a problem with other controls. So if I have:
@(Html.Infragistics().HtmlEditorFor(p => p.Person.Name) .Height("300") .Width("100%") .ShowTextToolbar(true) .ShowInsertObjectToolbar(true) .ShowFormattingToolbar(true) .ShowCopyPasteToolbar(false) .Render())
That will produce:
<div id="Person.Name"></div><script type="text/javascript">$(function () {$('#Person.Name').igHtmlEditor({ inputName: 'Person.Name', value: '', height: '300', width: '100%', showTextToolbar: true, showInsertObjectToolbar: true, showFormattingToolbar: true, showCopyPasteToolbar: false });});</script>
But no editor is rendered to the user. For now I decided to set it like "PersonName". You would ask, why to have an Html editor for a person name? well, it is just an example, don't take it so seriously. I don't want to extend on this issue because I found a solution but it is interesting that it is not possible to name a control the way I pretended to do it: with a dot in the middle. Thanks.
Hello,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.