Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2011, 11:49 AM
Authorized User
Points: 84, Level: 1
Points: 84, Level: 1 Points: 84, Level: 1 Points: 84, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Default Printing Web Pages

One of the requirements I have for my website project is the ability to print in an acceptable format. The first thing I noticed was the header container always prints on a separate page. I followed the directions in Chapter 6 for creating a Master Page. Does this have something to do with the way the container for the header is defined or something inherent in ASP.net programming?
 
Old June 30th, 2011, 12:00 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
The first thing I noticed was the header container always prints on a separate page.
I think it depends on your browser and printer. The default PW site fits on a single page for me.

You may want to take a look here: http://imar.spaanjaars.com/240/how-d...age-is-printed for some tips on printer-friendly pages. In addition, a Google seatch for "printer friendly css" brings up lots of useful stuff. In short, you need to size and hide / display your elements in a separate CSS file to accomodate printing.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 30th, 2011, 03:25 PM
Authorized User
Points: 84, Level: 1
Points: 84, Level: 1 Points: 84, Level: 1 Points: 84, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Default

I went you your website and found what I needed, but am having trouble setting up a client side script so I only have to enter the code once. I place the javascript file file in my top of my website and added a script line to my .master page.
Code:
	<script type="text/javascript" language="javascript" src="~/ClientSideScript.js"></script>
When I click on the link to print, all it does is take to to the top of my page. Any thoughts? The javascript does work if I put it into directly in the container for the head on an individual page.
 
Old July 1st, 2011, 05:19 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not sure what you need the JavaScript link for (the article I linked to discussed a CSS file), but you probably run into an issue with the ~ which is probably nnot resolved to the application's root. Try linking it as /ClientSideScript.js assuming the file is in the root of your website.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 1st, 2011, 10:56 AM
Authorized User
Points: 84, Level: 1
Points: 84, Level: 1 Points: 84, Level: 1 Points: 84, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Default Thanks!

Thanks Imar! Will give it a try. I just wanted to say thank you for all your help with the various issues I've had in setting up this project! My task today is to see how I can deploy this from my workstation to my webserver. My one concern is transferring the Membership/Roles tables to the database I am using. Everyday brings something new to learn.
 
Old July 1st, 2011, 04:29 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome. I just posted a reply to your post on deployment.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing multiple pages at a go leo_vinay ASP.NET 1.0 and 1.1 Professional 0 November 3rd, 2005 07:22 AM
Printing pages ken killeen VB.NET 2002/2003 Basics 0 October 27th, 2004 07:31 AM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM
Printing Several Pages Louisa VB.NET 2002/2003 Basics 1 April 8th, 2004 09:26 AM
Printing Web Pages gaghazoul VBScript 0 February 5th, 2004 02:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.