473,385 Members | 1,693 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.

Email contents of page

I want to be able to put into the body of an email, the entire contents of a
aspx page....with form fields filled out

I know I could go through and get the values of all of the textboxes, radio
button lists, etc, and format the body of my email, but it would be very
convenient if I could just have the email contain exactly what the page looks
like because the page is quite large.

I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
work, and I can get the page's rendered HTML into a StringBuilder variable,
but when the page posts back I get a "Page can only have one form runat
server....error.

So can this be done??

Thanks in advance!
John Scott.
Sep 12 '05 #1
8 1638
Hi John,

Does the page work if you don't email it? I'd imagine it doesn't. You
probably have 2 forms on the page which ASPX can't handle.

Just my 2 pence,
Jan

Sep 12 '05 #2
The page loads fine and I can fill out all the form values...the problem
exists when I click on a "Email Form" button....that's when the RenderControl
method is called and when the page posts back it acutally has two form tags
in the posted data.

--
Thanks,

John Scott.
"Jan Bannister" wrote:
Hi John,

Does the page work if you don't email it? I'd imagine it doesn't. You
probably have 2 forms on the page which ASPX can't handle.

Just my 2 pence,
Jan

Sep 12 '05 #3
Hi John,

Do not let the page post back. After you call RenderControl, redirect the
page to another page. You should not invoke RenderControl twice.

I believe this should work.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I want to be able to put into the body of an email, the entire contents of a
aspx page....with form fields filled out

I know I could go through and get the values of all of the textboxes, radio
button lists, etc, and format the body of my email, but it would be very
convenient if I could just have the email contain exactly what the page looks
like because the page is quite large.

I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
work, and I can get the page's rendered HTML into a StringBuilder variable,
but when the page posts back I get a "Page can only have one form runat
server....error.

So can this be done??

Thanks in advance!
John Scott.

Sep 12 '05 #4
I don't want to redirect to a different page, because I want to be able give
the user the ability to print the page either before OR after emailing the
form....

Redirecting would be the easy way out...but it won't work for me in the case.
--
Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

Do not let the page post back. After you call RenderControl, redirect the
page to another page. You should not invoke RenderControl twice.

I believe this should work.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I want to be able to put into the body of an email, the entire contents of a
aspx page....with form fields filled out

I know I could go through and get the values of all of the textboxes, radio
button lists, etc, and format the body of my email, but it would be very
convenient if I could just have the email contain exactly what the page looks
like because the page is quite large.

I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
work, and I can get the page's rendered HTML into a StringBuilder variable,
but when the page posts back I get a "Page can only have one form runat
server....error.

So can this be done??

Thanks in advance!
John Scott.

Sep 12 '05 #5
Hi John,

One question - why do you want to do a post back for printing? You could
handle this at the client side itself right?

This would make printing an independent task, which would also do away with
the RenderControl issue.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I don't want to redirect to a different page, because I want to be able give
the user the ability to print the page either before OR after emailing the
form....

Redirecting would be the easy way out...but it won't work for me in the case.
--
Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

Do not let the page post back. After you call RenderControl, redirect the
page to another page. You should not invoke RenderControl twice.

I believe this should work.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I want to be able to put into the body of an email, the entire contents of a
aspx page....with form fields filled out

I know I could go through and get the values of all of the textboxes, radio
button lists, etc, and format the body of my email, but it would be very
convenient if I could just have the email contain exactly what the page looks
like because the page is quite large.

I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
work, and I can get the page's rendered HTML into a StringBuilder variable,
but when the page posts back I get a "Page can only have one form runat
server....error.

So can this be done??

Thanks in advance!
John Scott.

Sep 12 '05 #6
The printing is actually done on the client-side...

The ideal situation is to allow the user to print out what ever they have
filled out...as well as be able to email the contents of the page....it
shouldn't matter to them which order they do it.

Does that make sense??

Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

One question - why do you want to do a post back for printing? You could
handle this at the client side itself right?

This would make printing an independent task, which would also do away with
the RenderControl issue.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I don't want to redirect to a different page, because I want to be able give
the user the ability to print the page either before OR after emailing the
form....

Redirecting would be the easy way out...but it won't work for me in the case.
--
Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

Do not let the page post back. After you call RenderControl, redirect the
page to another page. You should not invoke RenderControl twice.

I believe this should work.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:

> I want to be able to put into the body of an email, the entire contents of a
> aspx page....with form fields filled out
>
> I know I could go through and get the values of all of the textboxes, radio
> button lists, etc, and format the body of my email, but it would be very
> convenient if I could just have the email contain exactly what the page looks
> like because the page is quite large.
>
> I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
> work, and I can get the page's rendered HTML into a StringBuilder variable,
> but when the page posts back I get a "Page can only have one form runat
> server....error.
>
> So can this be done??
>
> Thanks in advance!
>
>
> John Scott.

Sep 12 '05 #7
Hmm...that is true.

The issue is you need to get the rendered contents (with user input) at the
server side, and re-display the same page so that the user may print it. This
is so that the user may do either printing or e-mailing in any order.

If you had somehow made printing always before e-mailing, then it could have
been simpler.

I am not getting any solutions to satisfy both requirements rt now :(. Let
me think it over...

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
The printing is actually done on the client-side...

The ideal situation is to allow the user to print out what ever they have
filled out...as well as be able to email the contents of the page....it
shouldn't matter to them which order they do it.

Does that make sense??

Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

One question - why do you want to do a post back for printing? You could
handle this at the client side itself right?

This would make printing an independent task, which would also do away with
the RenderControl issue.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
I don't want to redirect to a different page, because I want to be able give
the user the ability to print the page either before OR after emailing the
form....

Redirecting would be the easy way out...but it won't work for me in the case.
--
Thanks,

John Scott.
"Rakesh Rajan" wrote:

> Hi John,
>
> Do not let the page post back. After you call RenderControl, redirect the
> page to another page. You should not invoke RenderControl twice.
>
> I believe this should work.
>
> --
> HTH,
> Rakesh Rajan
> MVP, MCSD
> http://www.msmvps.com/rakeshrajan/
>
>
>
> "John Scott" wrote:
>
> > I want to be able to put into the body of an email, the entire contents of a
> > aspx page....with form fields filled out
> >
> > I know I could go through and get the values of all of the textboxes, radio
> > button lists, etc, and format the body of my email, but it would be very
> > convenient if I could just have the email contain exactly what the page looks
> > like because the page is quite large.
> >
> > I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
> > work, and I can get the page's rendered HTML into a StringBuilder variable,
> > but when the page posts back I get a "Page can only have one form runat
> > server....error.
> >
> > So can this be done??
> >
> > Thanks in advance!
> >
> >
> > John Scott.

Sep 12 '05 #8
That's exactly what I need...I also thought that in a worst-case scenario I
could just make an alert box pop up letting the user know that they need to
print the form before submitting it...kind of a lame solution, but it would
make things a lot easer. Please let me know if you have any other ideas.

Thank you for your quick reponses too!!

--
Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hmm...that is true.

The issue is you need to get the rendered contents (with user input) at the
server side, and re-display the same page so that the user may print it. This
is so that the user may do either printing or e-mailing in any order.

If you had somehow made printing always before e-mailing, then it could have
been simpler.

I am not getting any solutions to satisfy both requirements rt now :(. Let
me think it over...

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:
The printing is actually done on the client-side...

The ideal situation is to allow the user to print out what ever they have
filled out...as well as be able to email the contents of the page....it
shouldn't matter to them which order they do it.

Does that make sense??

Thanks,

John Scott.
"Rakesh Rajan" wrote:
Hi John,

One question - why do you want to do a post back for printing? You could
handle this at the client side itself right?

This would make printing an independent task, which would also do away with
the RenderControl issue.

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/

"John Scott" wrote:

> I don't want to redirect to a different page, because I want to be able give
> the user the ability to print the page either before OR after emailing the
> form....
>
> Redirecting would be the easy way out...but it won't work for me in the case.
> --
> Thanks,
>
> John Scott.
>
>
> "Rakesh Rajan" wrote:
>
> > Hi John,
> >
> > Do not let the page post back. After you call RenderControl, redirect the
> > page to another page. You should not invoke RenderControl twice.
> >
> > I believe this should work.
> >
> > --
> > HTH,
> > Rakesh Rajan
> > MVP, MCSD
> > http://www.msmvps.com/rakeshrajan/
> >
> >
> >
> > "John Scott" wrote:
> >
> > > I want to be able to put into the body of an email, the entire contents of a
> > > aspx page....with form fields filled out
> > >
> > > I know I could go through and get the values of all of the textboxes, radio
> > > button lists, etc, and format the body of my email, but it would be very
> > > convenient if I could just have the email contain exactly what the page looks
> > > like because the page is quite large.
> > >
> > > I've tried to do a Page.RenderControl(htmlTextWriter); ...this does acutally
> > > work, and I can get the page's rendered HTML into a StringBuilder variable,
> > > but when the page posts back I get a "Page can only have one form runat
> > > server....error.
> > >
> > > So can this be done??
> > >
> > > Thanks in advance!
> > >
> > >
> > > John Scott.

Sep 12 '05 #9

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

Similar topics

4
by: Paul Schmidt | last post by:
Dear list: I am new to python, and I am trying to figure out the short answer on something. I want to open a POP3 mailbox, read the enclosed mail using the POP3 module, , and then process it...
4
by: Rahul Chatterjee | last post by:
Hello All I have a web page which has a registration form. The user inputs data in the form and I would like to be able to send the entire form contents to an email address (In the HTML format)....
5
by: sifar | last post by:
Hi, This is my first post to this Group. A] I am trying to create a escalation page which will mail an escalation report of a faulty product. Items needed on Page: -----------------------
8
by: John Scott | last post by:
I want to be able to put into the body of an email, the entire contents of a aspx page....with form fields filled out I know I could go through and get the values of all of the textboxes, radio...
4
by: Carl Gilbert | last post by:
Hi I would to create a 'contact us' page which emails the contents of the page to a pre-defined email address. As I will be hosting the page on some 1&1 web space, I will have limited access to...
1
by: Beowulf | last post by:
I have a report laid out in Design View as shown at the end of this message. I have code that performs the following steps: 1. In main report's Report_Open(), DELETE any old rows in tblTOC for...
1
by: john_aspinall | last post by:
Hi, I want to send an email form on an ASP page and make it secure/ encrypted when sending it to the recipient. Does anyone know how I might easily achieve this - or should I be going through...
45
by: Dennis | last post by:
Hi, I have a text file that contents a list of email addresses like this: "foo@yahoo.com" "tom@hotmail.com" "jerry@gmail.com" "tommy@apple.com" I like to
2
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.