473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem emailing web page

I'm trying to send several emails using the webpage by getting a string
copy of it using the RenderControl() function of System.Web.UI.Page.
I've added code below
Program logic is:
hide some buttons and labels and controls,
render page send email,
Then
hide other parts, show other parts,
render again (fails here with "A page can have only one
server-side Form tag."),
send email
Then
redo process again.

it looks like its appending the page onto the original copy of it.
I've put the render function (below) in a separate class.

Is there another way to do this? or a correct way?
Thanks in Advance

public static string RenderFormControl(System.Web.UI.Page page)
{
StringBuilder SB = new StringBuilder();
TextWriter SW = new StringWriter(SB);
HtmlTextWriter htmlTW = new HtmlTextWriter(SW);
System.Web.UI.Page copyofThisPage = page; // shouldn't need
as page should

// be a Value parameter

copyofThis.RenderControl(htmlTW);
string retVal = SB.ToString();
copyofThisPage.Dispose(); // Tried
return retVal;
}

public override void VerifyRenderingInServerForm(Control control)
{ }

public override bool EnableEventValidation
{ get
{ return false; }
set { base.EnableEventValidation = value; }
}

Jan 11 '07 #1
0 866

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jonathan M. Rose | last post by:
I am looking for a script that I can sit on an HTML server (Linux, Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things: 1) Post news articles that consists of (i) a title...
0
by: Steven Scaife | last post by:
There seems to be a problem with my emailing code, although during testing it worked fine. What happens is it sends two emails instead of one, and also doesn't put any text in the email for some...
1
by: Stanley Cheung | last post by:
Hi all, I am developing the application for send emailing list, actually, i can perform to send a email 1 by 1 and do it on aspx page. I have a enquiry that how can the application change to...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
4
by: Trond Meistad | last post by:
I have a website where I run a simple asp.net web application. On Sunday night, requests to this webapplication started to time out. After much debuggeing with no result, I created a new...
0
by: Mike Grace | last post by:
Hi, I am writing a web site which sends order confirmations to users via email. Two changes that are needed are as follows: 1) PDF files are going to be attached to the email. It could be...
4
by: number1.email | last post by:
I have tried the following code: FileName: index2.php --------------------------------- <? mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" ); echo "Finished Emailing."; ?>
13
by: Giggle Girl | last post by:
Hi there, I am having a problem with the behavior of Firefox, where lefthand column content is not resized properly after it is "collapsed" and then "re-expanded". An online demo is available...
20
by: paul814 | last post by:
I've been working on this for some time now and have gotten nowhere...hoping someone here can help. I want to take and email all records in a database for the current date when this php page is...
10
by: paul814 | last post by:
I am having a bit of a problem with some code....can someone give me some suggestions? Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\production \date2.php on line 28 line 28 is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.