Search

Adding Social Bookmark Links to ASP.NET Pages

0 views

Social bookmarking is often thought of as being something used only on blogs. That's probably because you only see them on blogs, when they in fact could be used at most other types of websites as well. It is a feature that is very easy to add to any ASP.NET page, but I haven't found any simple code on the web I could use for it. So, as so many times before, I had to create the feature from scratch. In this case it was no problem because it is so simple. <%@ Register Src="~/controls/socialbookmarks.ascx" TagName="Bookmarks" TagPrefix="Control" %> Then add this at the end of the text on your page or anywhere else you want the icons to appear. <Control:Bookmarks runat="server" id="bookmarks"    OpenNewWindow="true"    LinkTitlePrefix="Add to"    PageTitle="Title of the page"    PageUrl="http://www.domain.com/thispage.aspx" /> It is very easy to add new bookmark providers to the list as you can see in this method in the user control: private void AddBookmarks() {    AddBookmark("http://digg.com/submit?phase=2&url={0}&title={1}", "Digg");    AddBookmark("http://del.icio.us/post?url={0}&title={1}", "del.icio.us");    AddBookmark("http://www.furl.net/storeIt.jsp?u={0}&t={1}", "FURL");    AddBookmark("http://reddit.com/submit?url={0}&title={1}", "Reddit");    ... } I used this page for finding the links needed to use all kinds of bookmarks and this page for the icons. The whole user control only consist of 2 methods and 4 properties so everyone should be able to customize it. Download Comments Tag: Add to Del.icio.us | Digg | Reddit | Furl Bookmark Murdok: Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Share this article

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!