Click here to Skip to main content
15,920,217 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Acces database on server Pin
Paul Riley11-Sep-02 23:49
Paul Riley11-Sep-02 23:49 
GeneralRe: Acces database on server Pin
Jeremy Falcon12-Sep-02 3:09
professionalJeremy Falcon12-Sep-02 3:09 
GeneralRe: Acces database on server Pin
Rickard Andersson2012-Sep-02 10:02
Rickard Andersson2012-Sep-02 10:02 
GeneralCreate threaded message board Pin
cool_guy11-Sep-02 21:13
cool_guy11-Sep-02 21:13 
GeneralRe: Create threaded message board Pin
Paul Watson11-Sep-02 23:47
sitebuilderPaul Watson11-Sep-02 23:47 
GeneralPrinter Friendly Page with too big data to be passed Pin
Mohammed Derbashi11-Sep-02 3:06
professionalMohammed Derbashi11-Sep-02 3:06 
GeneralRe: Printer Friendly Page with too big data to be passed Pin
Nick Parker11-Sep-02 5:47
protectorNick Parker11-Sep-02 5:47 
GeneralRe: Printer Friendly Page with too big data to be passed Pin
Paul Watson11-Sep-02 7:53
sitebuilderPaul Watson11-Sep-02 7:53 
Mohammed Derbashi wrote:
I'm trying to develope a printer friendly page

<Paul puts on his Preacher hat>
You should not be trying to develop a seperate page for printing, it is conceptually unsound. First off as you have pointed out it can lead to uneeded server load.

This is how you do it. You create two CSS files, one for the screen media, and the other for the print media. In the print media CSS file you basically use the display:none attribute to hide all the elements on the page you do not want to print. You also specify how you want the elments you want to print to look. In this way you can totally re-style a page for printing (e.g. getting rid of navigation, upping the font size, putting in page-breaks etc.) without two seperate ASP/HTML files. Also it requires no round trip to the server. The browser handles it for you.

To reference your two CSS files you do this:
<link rel="stylesheet" href="res/css/printable.css" type="text/css" media="print" /> for the print stylesheet and <link rel="stylesheet" href="res/css/default.css" type="text/css" media="screen" />

As an added bonus you can specify both media="screen, print" to say the default.css file applies to both media. Then when printing any duplicate classes in the printable.css file will override the default.css classes.

Now lets say you have an input element on your page that you do not want to be printed. You assign it a class like so <input type="text" class="inputelement" id="txtFirstName" /> and then in the printable.css file you create a new class like so input.inputelement{ display:none }

Here is a good article on it.

One great benefit of doing this is that should you make a change to the page it will show in the screen and print versions without you having to modify two seperate ASP files. So maintenance is greatly improved.

If you have any problems, just ask Smile | :)


</Paul puts on his Preacher hat>




Paul Watson
Bluegrass
Cape Town, South Africa

GeneralRe: Printer Friendly Page with too big data to be passed Pin
Not Active13-Sep-02 5:40
mentorNot Active13-Sep-02 5:40 
GeneralRe: Printer Friendly Page with too big data to be passed Pin
Paul Watson13-Sep-02 5:52
sitebuilderPaul Watson13-Sep-02 5:52 
GeneralASP surveys Pin
mcm11-Sep-02 0:51
mcm11-Sep-02 0:51 
Generalcombobox binding in ASP Pin
ramesh subbiah11-Sep-02 0:43
ramesh subbiah11-Sep-02 0:43 
GeneralRe: combobox binding in ASP Pin
Mohammed Derbashi11-Sep-02 3:27
professionalMohammed Derbashi11-Sep-02 3:27 
GeneralRe: combobox binding in ASP Pin
Nick Parker11-Sep-02 5:42
protectorNick Parker11-Sep-02 5:42 
GeneralRe: combobox binding in ASP Pin
Paul Riley11-Sep-02 7:09
Paul Riley11-Sep-02 7:09 
GeneralRe: combobox binding in ASP Pin
Nick Parker11-Sep-02 12:58
protectorNick Parker11-Sep-02 12:58 
GeneralRe: combobox binding in ASP Pin
Paul Riley11-Sep-02 13:12
Paul Riley11-Sep-02 13:12 
GeneralRe: combobox binding in ASP Pin
Nick Parker11-Sep-02 17:15
protectorNick Parker11-Sep-02 17:15 
GeneralDataGrid.DataBind effect doesn't last! Pin
D.D. de Kerf11-Sep-02 0:33
D.D. de Kerf11-Sep-02 0:33 
GeneralInherits system.web.ui.page Pin
sybux200010-Sep-02 22:58
sybux200010-Sep-02 22:58 
GeneralRe: Inherits system.web.ui.page Pin
Paul Watson11-Sep-02 7:58
sitebuilderPaul Watson11-Sep-02 7:58 
GeneralRe: Inherits system.web.ui.page Pin
sybux200012-Sep-02 7:44
sybux200012-Sep-02 7:44 
GeneralRe: Inherits system.web.ui.page Pin
Paul Watson12-Sep-02 21:13
sitebuilderPaul Watson12-Sep-02 21:13 
GeneralBgColor in aspx Pin
sybux20008-Sep-02 6:07
sybux20008-Sep-02 6:07 
GeneralRe: BgColor in aspx Pin
Enrico Elizar Samuel10-Sep-02 18:45
Enrico Elizar Samuel10-Sep-02 18:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.