Help adding Digg This button

Topics: ASP.NET 2.0, Controls
Mar 9, 2011 at 6:33 PM

I implemented the button and it works, but when i add the url to it (so it uses the post url instead of the page url).


Here is the unmodified "digg this" button code:

<a class="DiggThisButton DiggCompact" </a>

And here is the code i got from the blog engine documentation that feeds it the post url:<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>&amp;title=<%=Server.UrlEncode(Post.Title) %>


When i add it to the button as href ="...." it just stops working. Is it because of the " <% " tags?



Mar 10, 2011 at 4:28 PM


Mar 10, 2011 at 7:07 PM


Mar 10, 2011 at 10:00 PM

You also need to add runat="server" because "<%" tags indicate server-side code.

Mar 11, 2011 at 5:15 PM

Thanks for the reply rtur.


I tried it like you said but it still doesnt work:

<a runat="server" class="DiggThisButton DiggCompact" href="<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>"> </a>

Mar 12, 2011 at 12:40 PM


Mar 13, 2011 at 12:02 PM

Bump can someone please tell me how to get a digg button in blog engine?


<a runat="server" class="DiggThisButton DiggCompact" href="<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>"> </a>


Doesnt work

Mar 14, 2011 at 11:11 AM

Bump can someone give me some insight into these Digg buttons?

Mar 16, 2011 at 4:22 PM


Mar 17, 2011 at 3:17 AM

Try this:

<a class="DiggThisButton DiggCompact" href="<%=Server.UrlEncode(Request.Url.ToString())%>">Digg</a>

Mar 22, 2011 at 1:31 AM

Have you checked the outputted HTML to see what it looks like?  If so paste it here.

Mar 22, 2011 at 5:14 PM

Thanks for the help but i just decided to use a static button.