Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

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

Results 1 to 4 of 4
Share This Thread →
  1. #1
    vtecrocks is offline Registered User
    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
    Memnoch's Avatar
    Memnoch is offline Unholy Moderator
    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.

  3. #3
    vtecrocks is offline Registered User
    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

  4. #4
    Memnoch's Avatar
    Memnoch is offline Unholy Moderator
    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.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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

ASP Free Advertisers and Affiliates