Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp:LinkButton

Reply
Thread Tools

asp:LinkButton

 
 
Brian
Guest
Posts: n/a
 
      08-07-2007
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

 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      08-07-2007
"Brian" <> wrote in message
news:CD8AEA12-12F4-4A74-A2ED-...
>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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57