AddThis Html Helper now available via NuGetPosted on Thursday, December 15, 2011 at 2:25 PM in ASP.NET 0 comments
I have written and published my first Html Helper for MVC 3. It is the AddThis Helper which is currentlly at v0.65. I corrected an issue which was preventing it from installing properly via Nuget/Package Manager console. The helper lets one add 1 of the 9 AddThis styles. You can see those 9 types at AddThis.com/Get/Sharing. Using the helper is extremely easy. Install it via NuGet. Before using the helper you will need an AddThis account. This account is for the purposes of analytical data. Getting an AddThis account is easy and free. Head over to AddThis site and register. Once you have registered you will need to find your ProfileID. Hover over your username at the top of any AddThis page and go to Settings>My Profile. You will need this string in you web.config file.
In your web.config file, create a new entry in appSettings call pubid:
<add key="pubid" value="your profile id goes here" />
Once you have installed the package via NuGet, the helper can used in the page of your choice via:
In this example, the code will render the buttons as 32x32 icons. There are 9 methods that can be called with this helper. They are as follows:
Just call the appropriate method to render the AddThis style of your choice.
If you have any questions or comments post a comment below.
Comments:No comments have been made for this post. Be the first to leave a comment! Reply