473,388 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Dynamic IFrame Population

Hello,

I have an asp.net application. The application dynamically creates an
invoice. It is important to see and approve the invoice before it is
updated in the database.

So...I was dynamically creating a PDF file and writing the PDF file to
disk and then updating an ifram src attribute on the server side to
reference the newly created file.

I want to move away from disk-based dynamic generation to memory based
generation. So far so good. I now have a byte stream in memory
representing the PDF file.

My problem is I now want to dynamically populate the iframe with this
byte stream.

Any suggestions??

-Thanks,

Scott
Nov 18 '05 #1
1 2672
Create a new .aspx page where you use
Response.CotentType = "your content Type"
Response.BinaryWrite = your_byte_array

now to instantiate it within any other aspx object or say frame all you need
to do is call the above page and you can do all your funky duo code out
there....

never used iframes but dont think its such a big deal different

HTH

HD
----------------------------------------------------------------------------
---
use of the aspx as in my current code

<ItemTemplate>
<P align="center">
<asp:image id="Image1Data" runat="server" ImageUrl='<%#
"CA_DisplayImage.aspx?ProductColorID=" +
DataBinder.Eval(Container.DataItem,"ProductColorID ") +
"&IsDefaultImage=true&showThumbnail=true" %>' >
</asp:image>
</P>
</ItemTemplate>

----------------------------------------------------------------------------
---
code snippet for my Display image aspx page's page_load( ).

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// Check will be made on data being returned earlier to see if image 2
exists before
if(Request["ProductColorID"]!= null && Request["ProductColorID"]!="")
{
bool IsDefaultImage = true;
string ContentType = "";
bool showThumbnail = false;
if(Request["IsDefaultImage"]!=null && Request["IsDefaultImage"]!="" &&
Request["IsDefaultImage"].ToLower()!="true")
IsDefaultImage = false;
int ProductColorID = int.Parse(Request["ProductColorID"]);

if(Request["showThumbnail"] != null && Request["showThumbnail"] != "" &&
Request["showThumbnail"].ToLower() == "true")
showThumbnail = true;

ImagesDB myImage = new ImagesDB();
byte[] ImageData = myImage.GetImage(ProductColorID, IsDefaultImage, ref
ContentType);
if(ImageData != null)
{
if(showThumbnail == true)
GetThumbnailData(ref ImageData);
else
{
Response.ContentType = ContentType;
Response.BinaryWrite(ImageData);
}
ImageData = null;
}
else
{
DrawImageNotFound();
}
}
else
{
DrawImageNotFound();
}
}

"Scott Nichols" <sn******@cyscript.com> wrote in message
news:4a*************************@posting.google.co m...
Hello,

I have an asp.net application. The application dynamically creates an
invoice. It is important to see and approve the invoice before it is
updated in the database.

So...I was dynamically creating a PDF file and writing the PDF file to
disk and then updating an ifram src attribute on the server side to
reference the newly created file.

I want to move away from disk-based dynamic generation to memory based
generation. So far so good. I now have a byte stream in memory
representing the PDF file.

My problem is I now want to dynamically populate the iframe with this
byte stream.

Any suggestions??

-Thanks,

Scott

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: adam | last post by:
Hi - im looking to have two drop down boxs one with makes of car and the second drop down box to automatically populate with all the model of that particular make of car. there are about 50 makes...
2
by: Csaba2000 | last post by:
I want to be able to embed a single quote into an INPUT element within a dynamically generated IFRAME. The example below shows how the IFRAME is generated. Challenge: I'd like the alert box to...
2
by: Templar | last post by:
Hi i'm bothering with such problem... I must dynamic create an Iframe, and then put som raw HTML into it. But I can't. When I create iframe, I can't access its properties. Here's the coe...
1
by: tribal boy | last post by:
Guys, I am using a dynamic menu which uses xml,xsl a css file and javascript. This works fine when there are no server controls around or underneath it. The problem is whenever the menu...
8
by: hyejin | last post by:
I have a problem with dynamic iframe and document.close() on Firefox. Below two files create a dynamic iframe by JavaScript. These two samples do not have any problems on IE. But, on Firefox, the...
1
by: mike888 | last post by:
I want to create dynamic iframe content like below but in Firefox <iframe width="100%" height="100" src="#"></iframe> <script language="JavaScript"><!-- document.frames.document.open();...
1
by: redbaks | last post by:
Hi! I am trying to implement adding widgets to our template editor (for blogs). I am worried that i might open a window for XSS attacks so i decided to enveloped all widgets inside an iframe. ...
3
polymorphic
by: polymorphic | last post by:
I have succeeded in embedding PDF files in a dynamic iframe. The problem is that I need the PDF to cache. If the PDF remains the same from page load to page load then the pdf is somehow cached with...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.