I am trying to add a pinterest button to a control. I am trying to add the href in the code behind but it does not seem to be working.
so far i have
pinterestButton.Attributes.Add("href", "http://pinterest.com/pin/create/button/?url=" + productLink + "&media=" + imageLink);
The pinterest window opens up but there no data in it.
Can anyone give me a hand?
Thanks
It looks like you need to URI-encode the query string parameters, i.e.
"http://pinterest.com/pin/create/button/?url=" + productLink + "&media=" + imageLinkshould be:
"http://pinterest.com/pin/create/button/?url=" + HttpUtility.UrlEncode(productLink) + "&media=" + HttpUtility.UrlEncode(imageLink)I’m not an ASP/C# programmer, but a quick lookup shows that this is the correct method for URI-encoding.