ThickBox - update inside without redirect

Posted by Alex Maslakov on Stack Overflow See other posts from Stack Overflow or by Alex Maslakov
Published on 2011-01-07T05:39:04Z Indexed on 2011/01/07 5:53 UTC
Read the original article Hit count: 189

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery