How do you get rid of footer and header tags on print form in VB.net

When I print a form it has the tags at the top and bottom. Does anyone know how to get rid of those in VB.net when printing the form.

0
bootzilla
10/30/2008 2:57:09 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

4 Replies
973 Views

Similar Articles

[PageSpeed] 21

If you are talking about the default bits put out by the browser then I think you will have to wait until css3 is adopted. Failing that, can you try generating pdf files for your user? At least that way you'd have more control over what's being written.


The Old Sewing Factory
That twitter nonsense.
0
ilivewithian
10/30/2008 4:32:49 PM

Hi bootzilla,

You can use javascript to print it.

Here is an example, you can read it.

JavaScript CODE:
<script language="javascript" type="text/javascript">
    function printdiv(divID)
    {
        var headstr = "<html><head><title></title></head><body>";
        var footstr = "</body>";
        var newstr = document.all.item(divID).innerHTML;
        var oldstr = document.body.innerHTML;
        document.body.innerHTML = headstr+newstr+footstr;
        window.print();
        document.body.innerHTML = oldstr;
        return false;
    }
</script>

HTML CODE:
<input name="b_print" type="button" onclick="printdiv('divID');" value=" Print " />
<div id="divID">
<h1 style="color:green">
The Div content which you want to print</h1>
</div>


Sincerely,
Hua Jun Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hua
11/4/2008 3:21:18 AM

 you can set 2 different css files for your page

1. for screen by putting tag media="screen"

2. for print by putting tab media="print"

<link rel="stylesheet" media="print" href="CSS file name when u want to apply at the time of print" />
<link rel="stylesheet" media="screen" href="your file name for displaying on monitor" />

put each and every other classes same in both the css in print media css just set the header and footer visibility hidden.


 

 

0
zcon_sachin
11/4/2008 5:46:22 AM

The good practice is to use CSS for media printing. Check below link

http://webdesign.about.com/cs/css/a/aa042103a.htm

 


Haissam Abdul Malak
MCAD.NET
| Blog |
0
Haissam
11/4/2008 10:17:04 PM
Reply:

Similar Artilces:

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

non .net form issue within a .net form tag
this may be a bad question... but I am adding a shopping cart to my asp.net website and it calls for the following code for the 'buy now' buttons: <form method="POST" action=http://www.cart.net/cart.aspx/CartName><input type="hidden" name="ID" value="IDName"><input type="hidden" name="Describe" value="IDName Description"><input type="hidden" name="Price" value="100.00"><input type="hidden" name="QtyMax" value="1"><input t...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

Access forms vs vb.net forms
I have to do an windows application for an access database, which currently had access forms. I am trying to convince doing it in vb.net. I know I can do much better froms or front end with VB.net. I am not sure how to convince my boss or client. Thanks If you want info on Windows Applications try www.windowsforms.net. Here's how to convince them, if they are tight about money: vb.net = Only need one license, for you the programmer, which you may already have access = need an access license for every person that uses the program (shush, don't tell them about access runtime) I...

to print a form in vb.net
hi i want to know how to print an output form....

How to call One FORM from Another FORM IN VB.NET
I AM NEW TO VB.NET, I CREATE A REPORT USING REPEATER COMPONENT (FORM NAME IS REP_VIEW) IN ANOTHER FORM (REP_GET) I GET CODE,MONTH AND YEAR FROM THIS FORM (REP_GET) WHEN I RUN THE FORM REP_GET AND GET DETAILS OF CODE,MONTH,YEAR AND I CLICK THE VIEW BUTTON IN REP_GET FORM IMMEDAIATELY FORM_VIEW FORM HASTO BE OPEN AND REPORT  HAS TO BE VIEWED.  BASED ON CODE,MONTH,YEAR SQL QUERIES ARE IN CODE BEHIND OF FORM_VIEW , CONDITIONS ARE CODE,MONTH,YEAR,      WHICH IS GET FROM FORM_GET   PLEASE HELP ME   THANKS  ...

to print a form in vb.net #2
want to know how to print an output of a vb.net form...

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Creating a web form in VB.NET 2003
I apologise if this has been asked a thousand times.  Firstly, I am using VB.NET 2003 (v7.1.3088) and .NET Framework 1.1.4322  SP1 on WinXP Professional SP2 platform with all security and critical updates in place.My background: good old FoxPro, VB6 and VBA under Access (yuk!)I am playing about with a test project before hopefully upgrading to VB.NET 2005 and i am having a fundamental problem with web forms for a ASP.NET web application.  Whenever I copy and paste an object (text box, label, etc) VB.NET pastes the object back onto the form apparently correctly.  After up...

Deploying Vb.Net Web Forms on the server
I created a setup file for my first test Web Application. It has a few forms that I like to test on the server. What do I have to do on the server for it to work properly. I have it working on my dev machine. What do I have to install and is there any changes that I have to make to machine.config or any other files. I am using the default settings in Global and web.config files. These files were generated by the Vb.Net 2003. I have been reading on this for awhile and like to make sure of the steps I have to follow. Any help will be greatly appreciated....

login form for web services vb.net
Hi, I'm trying to create a windows form with  web services that check if the user and password are the same within the SQL SERVER DATABASE, if its the same then your a valid user if not your an invalid user. That is working ok, but I want to implement a try statement which only allows the user to enter in the details 3 times then the windows form shuts down. also if they do have it correct then another window opens up. ANY HELP PLEASE OR IF SOME 1 KNOWS HOW TO DO IT IN  ASP.NET :>  HERE THE CODE: <WebMethod()> _     &nbs...

Looping through controls in VB.Net Web Form
I need to disable every imagebutton. In VB6, I would have done it like this: 1 Dim iButton As ImageButton 2 For Each iButton In Me.Controls 3 iButton.Enabled = False 4 Next In .Net, I get a "Specified cast is not valid" errror on line 2. Using Page.controls in place of Me.Controls also produces the same error. So, I tried this (and multiple variations): 1 Dim ibControl As Object 2 For Each ibControl In Me.Controls 3 If TypeOf ibControl Is ImageButton Then 4 ...

Web resources about - How do you get rid of footer and header tags on print form in VB.net - asp.net.web-forms

Wikipedia:Manual of Style/Layout - Wikipedia, the free encyclopedia
This is a guide to laying out a typical basic article. Complicated articles may be best modeled on the layout of an existing article of appropriate ...

Alyson Footer (@alysonfooter) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Lead-footers hit the highway in NT
Police hit out at drivers who exceeded 200km/h during first hours of an open speed limits trial.

New Footer in Mobile Google Search
Google's mobile search results pages have a new footer. Pagination elements are now centered and there's a Google logo at the bottom of the page. ...

Michael Jordan nails 50-footer at golf tournament
Watch: Sports legend Michael Jordan proved he can still hit the big shot

Texas Italian-American Sports Foundation to honor Alyson Footer
Texas Italian-American Sports Foundation to honor Alyson Footer

Alyson Footer leaves Astros for mlb.com
Alyson Footer leaves Astros for mlb.

Is Tyson Chandler the NBA's Best Dressed Seven-Footer?
... of the New Yorks Knicks, but off the court, he likes to style on people. GQ has gone so far to say that Chandler is "the slickest seven-footer" ...

Astros Boxes Podcast: Alyson Footer, Social Media and Lance Berkman
Special Guests Alyson Footer and Terri Schlather discuss social media, Jerome Williams signing and Lance Berkman

Vince Carter Throws Down Throwback Jam Over Seven-Footer Rudy Gobert
Vince Carter Throws Down Throwback Jam Over Seven-Footer Rudy Gobert

Resources last updated: 12/18/2015 12:54:36 AM