“Tweet This” Link with TinyURL in ASP.Net

14 Mar

In migrating to my new blog platform, one thing that I am really excited about is now being able to put custom code to power features I was not able to have in Google Blogger.

The first thing I did was add some code-behind to my user controls to generate good “Tweet This” links so that users could Tweet my posts on Twitter.

 

Most samples you see for this simple stick your page URL in the query string.  This doesn’t often work, as the URL will be too long, as the user won’t be able to tweet the message.

 

I create two functions behind my page, TweetThisLink and TinyUrl

 

From my ASPX page, I can now insert a nice “Tweet This” link as follows:

Leave a Reply

Your email address will not be published. Required fields are marked *