Printing an ASP.NET Web Form When It Is Submitted
page 4 of 5
by Andrew Mooney
Average Rating: 
Views (Total / Last 10 Days): 56288/ 67

Using a Results Page

[Download Code]
The results page that I use simply iterates the querystring that was created by the web form printing class to display the results. One of the reasons for using a results page is that it allows the user to print a hard copy for their records. Yes, I know it's a waste of paper. The results page can easily be removed from the web form printing class if you do not need it for your application.


<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  <form runat="server" ID="Form1">
   <table cellspacing="1" cellpadding="1" border="0">
     <td bgcolor="navy" colspan="2">
      <font color="white" size="3">Results&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% = 
         System.DateTime.Now.ToString() %></font></td>
    <% string fieldValue;
    foreach ( string fieldName in Request.QueryString ) {
    if ( Request.QueryString[fieldName] != "" ) fieldValue = 
        Request.QueryString[fieldName] ;
    else fieldValue = "&nbsp;"; 
     <td align="right" bgcolor="lightskyblue"><b><%= fieldName %></b></td>
     <td bgcolor="lightskyblue"><%= fieldValue %></td>
    <% } %>

View Entire Article

User Comments

No comments posted yet.

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-02-25 8:40:11 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search