ThickBox - update inside without redirect
- by Alex Maslakov
ASP.NET MVC and jQuery ThickBox.
I show some content in ThickBox. It includes file upload form
The view multi-media.apsx (it's strange, the this editor doesn't allow start the line with "<" in the code)
form action="/upload/multi-media" method="post" enctype="multipart/form-data"
label for="file"File name:
input type="file" name="file" id="file" /
input type="submit" value="Upload" /
<% if (Model.Count > 0)
{
foreach (FileInfo mediaFile in Model)
{ <img width="100px" height="100px" src="<%:
ResolveUrl("~/audio.png") %>" border="0" alt="<%: mediaFile.Name %>"
/ //................
After file upload I redirect to /upload/multi-media action and content shows in normal window, not in ThickBox.
[ActionName("multi-media"), HttpPost]
public ActionResult MultiMedia(HttpPostedFileBase file)
{
if (file.ContentLength > 0)
{
file.SaveAs(GenerateNewFileName(fullFileName));
return View("multi-media", model);
}
}
How can I stay into ThickBox after file upload? I need show content in ThickBox all the time, even after the file upload.