Add Twitter Retweet To ASPX Page

3 replies
Hi,

My company wants me to add a retweet button to our website for every story we send out. Our pages are coded using ASPX and I cannot figure out how to have the headline and link of the stories pulled into a retweet button that would display on each page.

Any help would be great appreciated.

Chris
#add #aspx #page #retweet #twitter
  • Profile picture of the author RemingtonSteele
    ASP.NET doesn't need to be involved at all - you can just use the JavaScript code provided by TweetMeme:

    Code:
    http://help.tweetmeme.com/2009/04/06/tweetmeme-button/
    Just put the button on each web page that you want to allow people to retweet.

    You might not get this to work on localhost, so try it on your web server. I don't have any twitter accounts, so I can't test it out.

    Hopefully, this will be an acceptable solution for you. If your company expects you to roll your own retweet button, then you could check out this resource, although it involves ASP.NET MVC and Linq, which you may not be using:

    Code:
    http://mikebosch.net/2010/11/building-a-twitter-retweet-engine-w-asp-net-mvc-part-1/
    http://mikebosch.net/2010/11/building-a-twitter-retweet-engine-w-asp-net-mvc-part-2/
    Good luck.
    {{ DiscussionBoard.errors[3790378].message }}
    • Profile picture of the author sidharthbanyal
      You need to expose twitters API to use it.
      Signature

      Luck is dividend of Sweat. More you Sweat More you get luckier.

      {{ DiscussionBoard.errors[3793194].message }}
  • Profile picture of the author affiliatepro15
    We used to use the Tweetmeme button, but now Twitter offers their own solution.

    Tweet Button | dev.twitter.com

    You do NOT need to use the API to get this working. There are lots of variables you can set in the button code and a few different options/styles for adding it to your pages.

    By default, it will add the link to the current page and the title of the page. If you need to have more than one on the same page, you can just add the parameters for the url/headline when you write each button. If the pages are fully dynamic, then just create the button in your code behind file as a string with the info you want, then write it to the page.
    {{ DiscussionBoard.errors[3795288].message }}

Trending Topics