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

Print Page Functionality

P: n/a
I am looking for some code to duplicate something like on
http://www.charmeck.org/Site-Info/Home.htm when someone prints the
Print This Page link. This site is using MSCMS so it might be using
something built into that, but I am looking for straight ASP.NET/C#
code.

I was thinking of adding comments to my page:

<!--StartPrint-->

Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah,Blah,blah,blah,Blah,blah, blah,Blah,blah,blah,Blah,blah,blah,Blah,blah,blah, Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah

<!--EndPrint-->

Then when someone clicks Print Page, it calls PrintPage.aspx taking the
info from between the comments and formats and displays it.

Any thoughts, examples, or links to examples.

Thanks,
Greg

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Greg,

It's really kind of simple. All you have to do is set a link to
yourself, setting a flag in the querystring. Then, in your ASP.NET page, if
the flag is checked, you choose to leave out some of the formatting using a
conditional statement.

Or, if there is a consistent way that you know you can format the page
(always use the same font, remove header elements, or something of the
sort), you can have a page that takes the URL to format in the query string.
That page would load the page into memory, and format the page the way you
wish, returning the new content.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"hartbypass" <gh***@medex.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am looking for some code to duplicate something like on
http://www.charmeck.org/Site-Info/Home.htm when someone prints the
Print This Page link. This site is using MSCMS so it might be using
something built into that, but I am looking for straight ASP.NET/C#
code.

I was thinking of adding comments to my page:

<!--StartPrint-->

Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah,Blah,blah,blah,Blah,blah, blah,Blah,blah,blah,Blah,blah,blah,Blah,blah,blah, Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah

<!--EndPrint-->

Then when someone clicks Print Page, it calls PrintPage.aspx taking the
info from between the comments and formats and displays it.

Any thoughts, examples, or links to examples.

Thanks,
Greg

Nov 17 '05 #2

P: n/a
Greg,

It's really kind of simple. All you have to do is set a link to
yourself, setting a flag in the querystring. Then, in your ASP.NET page, if
the flag is checked, you choose to leave out some of the formatting using a
conditional statement.

Or, if there is a consistent way that you know you can format the page
(always use the same font, remove header elements, or something of the
sort), you can have a page that takes the URL to format in the query string.
That page would load the page into memory, and format the page the way you
wish, returning the new content.

Hope this helps.
"hartbypass" <gh***@medex.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am looking for some code to duplicate something like on
http://www.charmeck.org/Site-Info/Home.htm when someone prints the
Print This Page link. This site is using MSCMS so it might be using
something built into that, but I am looking for straight ASP.NET/C#
code.

I was thinking of adding comments to my page:

<!--StartPrint-->

Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah,Blah,blah,blah,Blah,blah, blah,Blah,blah,blah,Blah,blah,blah,Blah,blah,blah, Blah,blah,blah,Blah,blah,blah,Blah,blah,blah,Blah, blah,blah,Blah,blah,blah

<!--EndPrint-->

Then when someone clicks Print Page, it calls PrintPage.aspx taking the
info from between the comments and formats and displays it.

Any thoughts, examples, or links to examples.

Thanks,
Greg


Nov 17 '05 #3

P: n/a
Hi Nicholas,

Would you have an example written in C#? I think the latter is what I
would want to do. I would like to have one page that is my "Print
Page" and pass the information I want to print to it. That way if I
change the format or layout I only have to do it in one spot. That why
I was thinking of trying to grab the html from the page between the
comment block and pass that on to the print page.

Thanks,
Greg

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.