473,799 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2686
Create a new .aspx page where you use
Response.Cotent Type = "your content Type"
Response.Binary Write = 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_DisplayImag e.aspx?ProductC olorID=" +
DataBinder.Eval (Container.Data Item,"ProductCo lorID") +
"&IsDefaultImag e=true&showThum bnail=true" %>' >
</asp:image>
</P>
</ItemTemplate>

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

private void Page_Load(objec t sender, System.EventArg s 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()!="tr ue")
IsDefaultImage = false;
int ProductColorID = int.Parse(Reque st["ProductColorID "]);

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

ImagesDB myImage = new ImagesDB();
byte[] ImageData = myImage.GetImag e(ProductColorI D, IsDefaultImage, ref
ContentType);
if(ImageData != null)
{
if(showThumbnai l == true)
GetThumbnailDat a(ref ImageData);
else
{
Response.Conten tType = ContentType;
Response.Binary Write(ImageData );
}
ImageData = null;
}
else
{
DrawImageNotFou nd();
}
}
else
{
DrawImageNotFou nd();
}
}

"Scott Nichols" <sn******@cyscr ipt.com> wrote in message
news:4a******** *************** **@posting.goog le.com...
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
3744
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 and upto 50 models per make. I just would like to know the best way to do this - javascript or use a database? it would be a lot of code todo it in javascript wouldnt it?? help is very much appreciated thanks guys.
2
9367
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 show: Mom said, "Don't" instead of the current: Mom said, "Do not". The point of the exercise is that I will be passing arbitrary strings to the IFRAME and I want to ensure that the final string is the same as the original. So I'm interested...
2
47346
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 snipplet: //************************************* //*************************************
1
4304
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 encounters a server control, it closes itself.
8
5374
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 icon on the top corner keeps running with "loading" message on the bottom status bar even though the browser completed everything in the iFrame. The line that causes the problem is "document.close()" in the included JS file. If this line is...
1
5382
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(); document.frames.document.write('THis is the dynamic text for iframe above'); document.frames.document.close();
1
6894
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. whenever a user wants to insert an external widget to his blog, a script takes over and it will create a dynamic iframe and then the widget script will be inserted inside the iframe. i created a dynamic iframe using this code (I simplified it..)
3
5401
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 the html page. But if I try to navigate to another pdf in the IFRAME then no caching occurs. Is the problem in the IFRAME reloading instead of just refreshing the pdf? <SCRIPT type="text/javascript"> var pageNo; var nav; var iframe; var...
1
4919
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 another page in the same domain which also contains infragistics datagid populated with default data retrieved from Data Base. After creating the frame I am attaching it to the HTML DOM and show it as modal popup with OK and Cancel Button inside an...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.