Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
I'm facing issue with the print button present in the toolbar of IE.
Whenever i click the print button, the page's prerender event is called. This happens only in IE. When i try to print with Firefox, this does not happen.
I have an iframe in first.aspx page. In the prerender event handler, I'm giving the iframe source as follows.

iframe1.Attributes["src"] = "second.aspx"

In second.aspx, i read an image file, convert into byte array and display it in the first.aspx iframe as follows.

try
{
response.contenttype("image/jpeg");
response.binarywrite(img);
response.end();
}
catch(Exception ex)
{
response.write("Error loading the image");
}

The image is displaying properly in both firefox and IE. But when i try to print it, i'm getting error in IE.
Also, when i ran in debug mode, i found that on click of print button, the first.aspx's prerender event is being called (only in IE).
Can you kindly help me out with this. Its pretty urgent.
Thanks in advance.
Posted

1 solution

I doubt you can change IE, so can you make it so that the code works with it behaving as it is ? What is going wrong right now ?
 
Share this answer
 
Comments
Anoop Athreyasa 30-Aug-10 3:18am    
On some machines, i'm able to view the image and in some i'm not (in IE only). Kindly correct me if i'm wrong. According to my knowledge, when we click on the print button, it should just print whatever is there on the screen and not call any functions. But here, a call to prerender event is being made. But this doesnt happen with firefox.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900