#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0

    Smile How to create a "Email this page" button using aspx and c#


    Hi there,

    I need to create an "Email this page" button on a aspx page using c#. Upon clicking on the button, Outlook editor will be launched, with the HTML of the page already pasted into the body of the message. I tried the html tag mailto, but how can i programmatically paste the content of the page to the body of the message?

    Is there anyway this can be done?

    Any feedback is greatly appreciated.

    Thanks,
    James
  2. #2
  3. Unholy Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Oct 2003
    Location
    In hell, where did you think?
    Posts
    12,026
    Rep Power
    658
    You could do one of the following.

    1) Read the page into a variable and then assign the body to the variable.

    Using a link, instead of a button.
    Code:
    <A HREF='mailto:you@yourdomain.com?subject=Your Subject&body=" & Variable & "'>you@yourdomain.com</a>
    2) The easiest way would be to just provide a link to the page in the email.
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0

    Smile Please help!!! To create a "Email this page" link


    Thanks for the quick reply. I got the html mailto tag working fine, my problem is in the page load event of the page, how can i capture the content of the html page to a variable? like in

    <A HREF='mailto:you@yourdomain.com?subject=Your Subject&body=" & Variable & "'>you@yourdomain.com</a>

    how do i get the content of the page to Variable????

    will a httpclient object work? however when i try to set the mailto link, it is still loading the page in the page load function.......

    Thanks,
    James
  6. #4
  7. Unholy Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Oct 2003
    Location
    In hell, where did you think?
    Posts
    12,026
    Rep Power
    658
    Use the System.IO Namespaces methods to read the page.
    Last edited by Memnoch; March 23rd, 2004 at 01:08 PM.

Similar Threads

  1. Save button with Javascript in aspx file
    By garrydawkins in forum .NET Development
    Replies: 1
    Last Post: February 5th, 2004, 03:09 PM
  2. How to create a Browse/Attach file button in .NET?
    By Steve Schofield in forum ASP Development
    Replies: 0
    Last Post: May 3rd, 2002, 03:10 PM

IMN logo majestic logo threadwatch logo seochat tools logo