Help adding Digg This button

Topics: ASP.NET 2.0, Controls
Mar 9, 2011 at 7: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:

http://digg.com/submit?phase=2&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?

 

Thanks

Mar 10, 2011 at 5:28 PM

Bump

Mar 10, 2011 at 8:07 PM

Bump

Coordinator
Mar 10, 2011 at 11:00 PM

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

Mar 11, 2011 at 6: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="http://digg.com/submit?phase=2&url=<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>"> </a>

Mar 12, 2011 at 1:40 PM

Bymp

Mar 13, 2011 at 1: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 12:11 PM

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

Mar 16, 2011 at 5:22 PM

Bump

Coordinator
Mar 17, 2011 at 4:17 AM

Try this:

<a class="DiggThisButton DiggCompact" href="http://digg.com/submit?phase=2&url=<%=Server.UrlEncode(Request.Url.ToString())%>">Digg</a>

Mar 22, 2011 at 2:31 AM

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

Mar 22, 2011 at 6:14 PM

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