I got little tired of adding these social networking site post sharing links to my themes. And I saw that there were few web sites offering these ShareIt or AddIt buttons. Well, I decided to create my own custom control for it. Please see the following link for more details about the control and how to use it instructions. There is little piece of code that you will need to add to PostView to get to use title of your posts as well as URL. Notice that in following code, I have added a server side script that overrides RenderControl method to set LinkTitle and LinkUrl properties of ShareLink control. If you don't add this piece of code, the control will still work but it will pick up URL and title of page from client side. More details as present in the article.
Custom Link Sharing ASP.Net Control
<script runat="server">
public override void RenderControl(HtmlTextWriter writer)
{
socialShareLink.LinkUrl = Post.AbsoluteLink.AbsoluteUri;
socialShareLink.LinkTitle = Post.Title;
base.RenderControl(writer);
}
</script>
You can download PostView.ascx from the site and see how it is used. All other steps are same as described in article for the control.
Download PostView.ascx (1.60 kb)
How to hide navigation controls on Bing Map Silverlight control
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2024 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use