2014-02-25 2 views
0

서버에 게시 할 몇 가지 다른 항목이있는 파일 업로드 제어 기능이 있습니다. 그래서, 위의 항목을 포함하는 부분보기가 있습니다. 나는 목표의 대상을 Iframe으로 설정했다. 그리고 그것은 상태를 다시 유지하기 위해 페이지를 보존하지만 그것은 올바르게 작동하지 않는다.작업 후보기의 부분보기 새로 고침

사실 내 요구 사항은 부분보기를 새로 고쳐 최신 추가 항목을 가져오고 페이지의 상태도 제출 버튼 onclick을 유지 관리해야합니다.

뷰 페이지에서

:

<form action="/Tab/SaveDocumentFile" method="post" enctype="multipart/form-data" target="frame"> 
       @{ Html.RenderAction("_MyPartial");} 
       <iframe id="frame" name="frame" style=""></iframe> 
      </form> 
<script> 
    RefreshGrid();//The method that gets records from table by ajax and bind the grid. 
</script> 

이것은 부분도

<input type="text" name="txtDocName" /> 

    <input type="hidden" id="hdnClientID" name="HdnClient" /> 

    <input type="file" name="file_Uploader" /> 


    <div class="footer"> 
     <div class="footer-heading">Previous documents</div> 
     <div class="footer-heading"> 
      <div id="DocListDiv" style="display: none; margin-top: 2%;"></div> 
     </div> 
    </div> 

</div> 


<input type="submit" id="btnSaveDocument" /> 

컨트롤러

public ActionResult SaveDocumentFile(HttpPostedFileBase file_Uploader, FormCollection collection) 
     { 
After Performing the upload of file 
    return RedirectToAction("_MyPartial", "Tab"); 
} 

이는 _MyPartial 방법

public ActionResult _MyPartial() 
     { 

      ViewBag.Type = new SelectList(TypeList, "Id", "Type"); 
      return PartialView("../Shared/Partial/_MyPartial"); 
     } 
이다,

답변

0

iframe 대신 iframe 내부에서 부분보기를 얻은 다음 부분보기에서 <form> 태그를 가져 와서 게시하려고하면 부분보기로 iframe 소스를 전달해야합니다.