I have a collection of models for each item from that collection, I have to present some HTML form. So I decide to create an editor template for this model.
This is editor editor like me "call".
& lt;% (int i = 0; i
And this is my template:
& lt;% @ Control language = "C #" Inherits = "System.Web.Mvc.ViewUserControl & Lt; Model Application.ListingSpaceAttachmentModel & gt; "& Gt%; & Lt;% @ Import Namespace = "Web Extension"% & gt; & Lt; Div id = "SpaceImagesControl" class = "attachment-upload-control" & gt; & Lt; Input type = "hidden" class = "attachment-type" value = "image" /> & Lt; Input type = "hidden" class = "is-dynamic-attachment-list" value = "true" /> & Lt; Div class = "form-field uploader field" & gt; & Lt; Div id = "listingspace image uploader" class = "attachment-uploader" style = "margin-left: 60px;" & Gt; & Lt; Button class = "upload-btn btn-sm" & gt; & Lt; Strong & gt; Add & lt; / Strong> & Lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "uploader-data-section" & gt; & Lt; Input class = "base-attachment-src" type = "hidden" /> & Lt; Input class = "base-preview-attachment-src" type = "hidden" /> & Lt; Input class = "attachment-src" type = "hidden" /> & Lt; Input class = "img-width" type = "hidden" /> & Lt; Input class = "img-height" type = "hidden" /> & Lt; Input class = "img-ratio" type = "hidden" /> & Lt; / Div & gt; & Lt; Div class = "attachment-data-section" & gt; & Lt;%: HTML.HiddenFor (m = & gt; m.AttachmentId)% & gt; & Lt;%: Html.HiddenFor (m = & gt; M. Attachment Type)% & gt; & Lt;%: HTML.HiddenFor (m = & m; OrdinalNumber)% & gt; & Lt;%: HTML.HiddenFor (m = & gt; m.AttachmentTitle, new {@ class = "attachment-title-input"})% & gt; & Lt;%: HTML.HiddenFor (m = & gt; M. AttachmentPath, new {@ class = "attachment-input"})%> & Lt;%: HTML.HiddenFor (m = & gt; m.AttachmentOriginalPath, new {@ class = "attachment-original-input"})% & gt; & Lt; / Div & gt; & Lt; Div class = "attachment-container-template" style = "display: none;" & Gt; & Lt; Div class = "attachlinkcontentware imgLload container" & gt; & Lt; Input type = "hidden" class = "attachment-input-name" value = "attachment name" /> & Lt; Input type = "hidden" class = "attachment-base-input-name" value = "attachment ornam" /> & Lt; Input type = "hidden" class = "attachment-title-input-name" value = "attachmenttitle" /> & Lt; Div class = "attachment control image control" & gt; & Lt; Period & gt; & Lt; A class = "delete-attachment-delete BTN-image-btn" href = "#" & gt; & Amp; Nbsp; & Lt; / A & gt; & Lt; Class = "set-main-attachment-btn set-main-image-btn" href = "#"%> "& Gt; & amp; nbsp; & lt; / a & gt; one class =" preview-attachment-BTN preview-image-btn "href =" # "%> & Gt; & Amp; Nbsp; & Lt; / A & gt; & Lt; / Span & gt; & Lt; A class = "attachment-thumbnail image-thumbnail" href = "javascript: return false;" & Gt; & Lt; Img alt = "ImageName" src = "" /> & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "attachment-section photo-section" & gt; & Lt; / Div & gt; & Lt; / Div & gt;
When I run my web app, I think that there is nothing present with the Editor Template HTML. I check it in debug mode - this is known through the editor template. Do not know why there is nothing. As @ Stephen:
Update: I said, I try to update my editor to collect the duplicate To prevent IDs, I add a model
public class attachment model {public attachments model () {Attached list = new list & lt; Litting AttemptModel & gt; (); } Public ILIT & lt; Listing Attachment Model & gt; {Attachment list}; Set; }}
which lists the elements, and now I pass it in the editor. But only get it from the editor: system. Selection. GenericList '1 [model. application. Listing AttachmentModel]
Do not know why I do such things before
Comments
Post a Comment