「FilePopUp」という名前のビューフォルダに部分的なビューを追加します。ここではTelerikWindowControlを使用します
コード:-
<% Html.Telerik().Window()
.Name("PopupWindow")
//.Title("View PDF")
//.Icon(Url.Content("~/Content/Common/Icons/favicon.png"), "favicon")
.LoadContentFrom(Model.PDFFilePath).Modal(true)
.Buttons(buttons => buttons.Close(Url.Action("Controller", "Action")))
//.Buttons(buttons => buttons.Maximize(Url.Action("Controller")).Close(Url.Action("Controller", "Action")))
.Scrollable(false)
.Resizable()
.Draggable(true)
.Width(870)
.Height(500)
.Render();
%>
あなたのコントローラーで:-
public ActionResult GetPdffile(string id)
{
try
{
FilePathAdmin filePath = new FilePathAdmin();
filePath.ERAPDFFilePath = this.WorkerService.GetPdfFilepath(id);
//string filepath = this.WorkerService.GetPdfFilepath(ID);
return PartialView("PopUpWindow", filePath);
}
catch (Exception ex)
{
bool reThrow = ExceptionPolicyWrapper.HandleException(ex, ExceptionPolicies.MVCPolicy);
if (reThrow)
throw;
}
return null;
}
モデルクラスで、「FilePathAdmin」という名前の別のクラスを作成し、その中に次のコードを記述します
public class FilePathAdmin
{
public string ERAPDFFilePath { get; set; }
}
そしてそれはそれです..あなたは完了です