This question is locked. New answers and comments are not allowed.
Hi Guys,
I have problem with Window in MVC in my web application. I was trying to get PDF from server side and return to view.
server side code :
byte[] pdf = null;
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
long numBytes = new FileInfo(filePath).Length;
pdf = br.ReadBytes((int)numBytes);
return File(pdf, "application/pdf");
then after i want to display PDF in iframe which is available in window. but it could display PDF. it display PDF few seconds, then it display like image which i attached.
this is my .cshtml code
@{Html.Telerik().Window()
.Name("Window")
.LoadContentFrom("GetPDF?InvoiceID=1683714)
.Title("View Invoice")
.Content(@<text>
@using (Html.BeginForm("popupform", "window", FormMethod.Post, new { id = "InvoiceID" }))
{
if (Session["InvoiceID"] != null)
{
<iframe src="GetPDF?InvoiceID=1683714" width="100%" height="100%"/>
}
}
</text>)
.Width(400)
.Height(500)
.Draggable(true)
.Modal(true)
.Visible(false)
.Render();
}
I have problem with Window in MVC in my web application. I was trying to get PDF from server side and return to view.
server side code :
byte[] pdf = null;
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
long numBytes = new FileInfo(filePath).Length;
pdf = br.ReadBytes((int)numBytes);
return File(pdf, "application/pdf");
then after i want to display PDF in iframe which is available in window. but it could display PDF. it display PDF few seconds, then it display like image which i attached.
this is my .cshtml code
@{Html.Telerik().Window()
.Name("Window")
.LoadContentFrom("GetPDF?InvoiceID=1683714)
.Title("View Invoice")
.Content(@<text>
@using (Html.BeginForm("popupform", "window", FormMethod.Post, new { id = "InvoiceID" }))
{
if (Session["InvoiceID"] != null)
{
<iframe src="GetPDF?InvoiceID=1683714" width="100%" height="100%"/>
}
}
</text>)
.Width(400)
.Height(500)
.Draggable(true)
.Modal(true)
.Visible(false)
.Render();
}