Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC3 Razor view not rendering dynamically added controls on postback
    primarykey
    data
    text
    <p>I have to upload selected files and display these files as links on post back. In my view I am adding each of the uploaded files as links using</p> <pre><code> @if (Model.IncidentLogInfoDetails.AttachmentCollection.AttachmentItemCollection.Any()) { foreach (EML.Container.Attachment attachmentItem in Model.IncidentLogInfoDetails.AttachmentCollection.AttachmentItemCollection) { @Html.ActionLink(attachmentItem.FileName, "testing") } } </code></pre> <p><strong>this is my controller action:</strong></p> <pre><code> public ActionResult UploadingFiles(HttpPostedFileBase imageFile) { // Converting to Attachment object Attachment fileAttachment = new Attachment(); fileAttachment.FileName = "imageFile.FileName"; fileAttachment.ContentType = imageFile.ContentType; fileAttachment.SizeInBytes = imageFile.ContentLength; using (MemoryStream ms = new MemoryStream()) { imageFile.InputStream.CopyTo(ms); fileAttachment.BinaryData = ms.GetBuffer(); } IncidentDetails incidentDetails = new IncidentDetails(); incidentDetails.IncidentLogInfoDetails = new IncidentLogInfo(); incidentDetails.IncidentLogInfoDetails.AttachmentCollection.AttachmentItemCollection = new List&lt;Attachment&gt;(); incidentDetails.IncidentLogInfoDetails.AttachmentCollection.AttachmentItemCollection.Add(fileAttachment); return View("FileUploadingTest", incidentDetails); } </code></pre> <p>My problem is that even though the loop is getting executed and Action links are created ( on debugging), they are not displayed after post back. <br>What am I missing ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload