?
Solved

How to do a print preview page in asp.net 2.0

Posted on 2007-10-04
5
Medium Priority
?
309 Views
Last Modified: 2013-11-26
I am developing an asp.net email app and need to do a print preview page.

I have for example the message object

                     EmailMessage message = new EmailMessage();
                    message.ID = Guid.NewGuid();
                    message.Priority = 1;
                    message.EmailSubject = subject.Text;
                    message.EmailTo = row.Cells[3].Text;
                    message.EmailFrom = fromemail.Text;
                    message.EmailBCC = "";
                    message.EmailCC = copyto.Text;
                    message.EmailBody = ftb.Text;
                    message.Status = 0;
                    StringDictionary namevalue = GetPreparedNameValue(message);
                    EmailMessage templatedmessage = EmailTemplate.GetTemplatedMessage("GenericEmailTemplate", message, namevalue);
                    EmailQueue.Send(templatedmessage);


It uses a HTML template and I need the best way to do a "print preview" screenshot
0
Comment
Question by:mugsey
  • 3
  • 2
5 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014439
Do you want to send the screen shot of the page as a file in email??
I do not understand what you are trying to do with a email component and a print preview.
0
 

Author Comment

by:mugsey
ID: 20014804
I am  using my own mass emailer component and it is template driven.  I the user enters the BODY of the text and then I need to be able to preview the BODY and the header and footer templates
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20014824
Are you generating a HTML mail or a text mail?
Either ways you could just pass the HTML of the body with header and footer to another page to just display the HTML
0
 

Author Comment

by:mugsey
ID: 20016295
Well the templates are of .txt extension.  How can I do this?
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 2000 total points
ID: 20016326
After u get the template applied. MailMessage object should contain the header/ footer and the actual payload of the mail. You should be able to view it by passing the contents of MailMessage.Body to another page so the user may look at how it is going to display when the mail gets through.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question