I'm using pdfviewer with Devexpress, when I call a partial view with the pdfviewer it works perfectly, but when I do the same from a popup window, it execute the partial view correctly, but it doesn't show the pdf, same file name, same everything
this is the code in Devexpress gridview
settings.SetEditFormTemplateContent(
c =>
{
Html.RenderAction("ThroughView", "VisorPDF", new { RutaDocumento = DataBinder.Eval(c.DataItem, "RutaDocumento"), IDFolio = DataBinder.Eval(c.DataItem, "IDFolio") });
Html.DevExpress().Button(
btnSettings =>
{
btnSettings.Name = "btnSalir";
btnSettings.Text = "Salir";
btnSettings.Style[HtmlTextWriterStyle.MarginLeft] = "5px";
btnSettings.ClientSideEvents.Click = "function(s, e){ gridViewRowSigned.CancelEdit(); }";
}).Render();
this is the code in controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult ThroughView(string RutaDocumento, string IDFolio)
{
string Ruta = WebConfigurationManager.AppSettings["PathDoctosViewer"].ToString() + IDFolio + "\\";
int nombrePosicion = RutaDocumento.LastIndexOf('\\');
string nombreDocumento = RutaDocumento.Remove(0, nombrePosicion + 1);
//string url = "..\\Content\\Doctos\\" + IDFolio + "\\" + IDFolio + "-" + nombreDocumento;
string path;
path = Ruta + IDFolio + "-" + nombreDocumento;
//path = path + "/Content/Doctos/167/167-301-B.pdf";
ViewData["filestr"] = path;
if (this.HttpContext.Request.IsAjaxRequest())
return PartialView("_VisorPDF", ViewData);
return View();
}
and this is the partial view with the pdfviewer;
@{ try{Html.Syncfusion().PdfViewer("PdfView")
.Load((string)ViewData["filestr"])
.PdfParamsArgs((PdfViewerParams)ViewData["PdfParam"])
.Width(System.Web.UI.WebControls.Unit.Percentage(100))
.ShowToolbar(true)
.Render();
}
catch { };}
I'm attaching 2 images with the result: with popup and without.
Attachment:
WithPopUp_e0a6f54d.zip