asp:LinkButton

B

Brian

I have a page that contains an asp:LinkButton. The purpose of this button
is to allow the user to send the current page as an email. My "plan" was
to, in the click event handler of the LinkButton, store the html source for
the current page in the viewstate and take the user to another page where
they can type in the email address they would like the page sent to. I
guess my question is:

1) Is this the best way to do it?
2) How in the world do I access the HTML for the current page from code
behind?

TIA

Brian
 
R

Riki

Brian said:
I have a page that contains an asp:LinkButton. The purpose of this button
is to allow the user to send the current page as an email. My "plan" was
to, in the click event handler of the LinkButton, store the html source for
the current page in the viewstate and take the user to another page where
they can type in the email address they would like the page sent to. I
guess my question is:

1) Is this the best way to do it?
2) How in the world do I access the HTML for the current page from code
behind?

Usually, this is done with the RenderControl() function, which can render a
control (or even a page) on any "surface", also in a mail.

But this would require you to reproduce the same content in a kind of user
control, keeping state in the process.

I would suggest sending the mail in the same page, that would be much
easier.
Try to move the content for the mail to a user control, that you can re-use
both in the page and in the mail.

Group the controls for sending the mail in a panel that you can show and
hide if you need to.

Riki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top