Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4058872
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:08:04+00:00 2026-05-20T15:08:04+00:00

I have an asp.net web page created with web forms. It has a number

  • 0

I have an asp.net web page created with web forms. It has a number of gridviews on it which are populated from a database on a button click.

I am looking to print a version of this page on a different button click. I’m looking to customize the printed page, with some text that is specified, then the gridview contents (user friendly version), then some more text etc

Any help is greatly appreciated

Marc

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:08:05+00:00Added an answer on May 20, 2026 at 3:08 pm

    The simplest solution is to use CSS to show and hide different elements depending on whether they are intended for screen or print. Include all elements in the page output (both print and screen) and use CSS to control them.

    Here’s a very simple example – let’s say you have a summary text that should only be included in the print version, and some buttons that should only be included in the screen version.

    Markup:

    <p class="printOnly">
        Here is my summary text.
    </p>
    <asp:button ID="btnSomeButton" runat="server" Text="Some Server Button" CssClass="screenOnly" />
    

    CSS:

    @media print {
        .screenOnly { display: none; }
    }
    
    @media screen {
        .printOnly { display: none; }
    }
    

    In the end any element marked with CSS class screenOnly will be hidden from print content, and any element marked with CSS class printOnly will be hidden from the screen version.

    From there simply have a print button or link on the page somewhere with:

    <a href="#" onclick="window.print();" class="screenOnly">Print Page</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net web page, which uses a Master Page template. The page
I have an ASP.NET web page that displays a variety of fields that need
I have an asp.net web page written in C#. Using some javascript I popup
I have an ASP.NET web page with a Login control on it. When I
I have an asp.net web page with a ton of code that is handled
I have a asp.net web page with place holder control and Menu control when
I have an asp.net update web app. Users go the the page, hit the
I'm writing a web page in ASP.NET. I have some JavaScript code, and I
In ASP.net 2.0, the PreviousPage property of a web page does not have a
Background I have a page on my ASP.NET MVC web app for users to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.