ASP.NET MVC und jQuery ThickBox. Ich zeige etwas Inhalt in ThickBox. Es enthält Datei-Upload-FormularThickBox - Update ohne Umleitung
Der Blick Multi-media.apsx
<form action="/upload/multi-media" method="post" enctype="multipart/form-data">
<label for="file">File name:</label><br />
<input type="file" name="file" id="file" /><br />
<input type="submit" value="Upload" />
</form>
<% if (Model.Count > 0) { %>
<% foreach (FileInfo mediaFile in Model) { %>
<img width="100px" height="100px"
src="<%:ResolveUrl("~/audio.png") %>" border="0" alt="<%: mediaFile.Name %>" /> //................
Nach Datei-Upload mir /upload/Multi-Media- Aktion und Inhalt im normalen Fenster, nicht in ThickBox zeigt umleiten.
Wie kann ich in ThickBox nach Datei-Upload bleiben? Ich muss die Inhalte in ThickBox ständig anzeigen, auch nach dem Hochladen der Datei.
UPDATE: Die Ajax-Datei hochladen. Wie auch immer, lade ThickBox neu. Warum?
Der Blick Mehr media.apsx
<div id="mydiv"> <% Html.RenderPartial("MultiMediaDetails", Model); %> </div>
MultiMediaDetails.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<FileInfo>>"%> <%@ Import Namespace="System.IO" %> <% using (Ajax.BeginForm("multi-media", "upload" , new AjaxOptions { UpdateTargetId = "mydiv", HttpMethod = "Post" }, new { enctype = "multipart/form-data" })) { %> <label for="file">File name:</label><br /> <input type="file" name="file" id="file" /> <input type="submit" value="Upload" /> <% }%> <% if (Model.Count > 0) { foreach (FileInfo mediaFile in Model) { //................... .............."/>
Einrückcode mit 4 Leerzeichen. '<' wird unterstützt. – Jacob