asp:LinkButton

Discussion in 'ASP .Net' started by Brian, Aug 7, 2007.

  1. Brian

    Brian Guest

    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
    Brian, Aug 7, 2007
    #1
    1. Advertising

  2. Brian

    Riki Guest

    "Brian" <> wrote in message
    news:...
    >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
    Riki, Aug 7, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RSB
    Replies:
    6
    Views:
    4,272
    avnrao
    May 14, 2004
  2. Phil Winstanley [Microsoft MVP]

    Re: How to Ignore a Asp:Button or asp:linkbutton click

    Phil Winstanley [Microsoft MVP], May 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    452
  3. Sathyaish
    Replies:
    3
    Views:
    3,096
    Sathyaish
    Sep 8, 2005
  4. BobLaughland
    Replies:
    2
    Views:
    9,305
    Alexey Smirnov
    Aug 15, 2007
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    179
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page