By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

iframe printing problem

100+
P: 121
hello,
i really need help from you experts.
my problem is i have one page abc.aspx, and then their is other page called def.aspx(which is printable version), which gives some information used for printing , now my requireement is that i want abc.aspx page to be displayed in def.aspx (empty abc.aspx just with its design) but i dont want to copy paste my abc.aspx code in def.aspx page as abc.aspx page is very big(340kb).

any help will be appreciated and if this is not possible please let me know as well

Regards
Oct 7 '08 #1
Share this Question
Share on Google+
8 Replies


kenobewan
Expert 2.5K+
P: 4,871
Well done, was it solved by using master pages?
Oct 7 '08 #2

100+
P: 121
nops, i figured out, something called iframe. but i am having another problem now..

as i have an iframe in a page and my page has a print button on it, so whenever i give it a print command rather than printing whole content of iframe , its printing only first page of data in iframe(as source page for iframe is quite long, should take 3 pages to print).

any help..
Oct 7 '08 #3

100+
P: 121
hello,
i have an iframe in a page and my page has a print button on it, so whenever i give it a print command rather than printing whole content of page( data on page+ iframe content) , its printing data on page but only first page of data in iframe(as source page for iframe is quite long, should take 3 pages to print).

any help with coding will be appreciated


Regards
Oct 7 '08 #4

Frinavale
Expert Mod 5K+
P: 9,731
I think there is a much easier solution to your problem.
If you have one page and only want to print certain content on that page you can create a Print Style Sheet (Css2 Print Reference).

Just place the content that you don't want to be printed in panels that are set to a class that has "display:none" set when printing the page.

Please do not double post your question.

-Frinny
Oct 7 '08 #5

100+
P: 121
I think there is a much easier solution to your problem.
If you have one page and only want to print certain content on that page you can create a Print Style Sheet (Css2 Print Reference).

Just place the content that you don't want to be printed in panels that are set to a class that has "display:none" set when printing the page.

Please do not double post your question.

-Frinny
but my problem is different,

i'll explain it in brief..

i have three <div> in my page.

1st <div> have some textboxes etc
2nd <div> have some more data
now my third <div> has a <iframe>

and i have a print button on my page irrespective of my division, now when i click on this print button, the data on <div> 1st and 2nd prints fine but for 3rd <div> as it has iframe it just prints one page( i know the page i m trying to print in around 3 pages) , basically my problem is what should i add in my code so that i prints every thing in iframe + other data on my page in one go.

Regards
Oct 8 '08 #6

Frinavale
Expert Mod 5K+
P: 9,731
but my problem is different,

i'll explain it in brief..

i have three <div> in my page.

1st <div> have some textboxes etc
2nd <div> have some more data
now my third <div> has a <iframe>

and i have a print button on my page irrespective of my division, now when i click on this print button, the data on <div> 1st and 2nd prints fine but for 3rd <div> as it has iframe it just prints one page( i know the page i m trying to print in around 3 pages) , basically my problem is what should i add in my code so that i prints every thing in iframe + other data on my page in one go.

Regards

Hmm interesting.

I've never tried to print a page that contains an IFrame....does the IFrame show an aspx page that is your content? or is it showing a page from somewhere else?

If it's yours I recommend changing it into an .ascx (user control) that you can add to your 3rd <div>. This way you can print everything.

I'd have to do more research on how to print the content of an IFrame because I've never tried what you're trying here.

Let me know if what I've recommended is feasible.

-Frinny
Oct 8 '08 #7

100+
P: 121
Hmm interesting.

I've never tried to print a page that contains an IFrame....does the IFrame show an aspx page that is your content? or is it showing a page from somewhere else?

If it's yours I recommend changing it into an .ascx (user control) that you can add to your 3rd <div>. This way you can print everything.

I'd have to do more research on how to print the content of an IFrame because I've never tried what you're trying here.

Let me know if what I've recommended is feasible.

-Frinny
thanks frinny for ur time,

but as the page i am calling in my iframe is an aspx page, and in a same project. as my requirement is i'll be giving printout to someone with all the information( div1,2,3) and that guy will fill that form and then i have to fill that form manually in my system. now the page in iframe is filled manually afterwards. and i m calling it in iframe only bcoz i dont want to copy paste my html coding in my i frame page( as this is very big around 270 entries are to be made) , just doing some code reusability.

i have searched through internet for couple of days, but couldnot find solution. and now wonder is their any solution to this problem..

Regards
Oct 8 '08 #8

jhardman
Expert 2.5K+
P: 3,405
thanks frinny for ur time,

but as the page i am calling in my iframe is an aspx page, and in a same project. as my requirement is i'll be giving printout to someone with all the information( div1,2,3) and that guy will fill that form and then i have to fill that form manually in my system. now the page in iframe is filled manually afterwards. and i m calling it in iframe only bcoz i dont want to copy paste my html coding in my i frame page( as this is very big around 270 entries are to be made) , just doing some code reusability.

i have searched through internet for couple of days, but couldnot find solution. and now wonder is their any solution to this problem..

Regards
The issue you are describing is the exact reason for which "printer friendly versions" were invented - they put all the text in a single in-line document. An i-frame is not part of that document, it is treated by most browsers as a window painted with the current view of the contents of the frame, so when you go to print it, you get exactly that: a view of the current contents that fit in that frame.

Have you looked into server-side includes? They allow you to include the contents of another page in-line with your page.

Jared
Oct 8 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.