Facebook Like Button - Basic ASPX Pages

How do I add a FaceBook button to the "like" button on my master pages, do I need to be different for each page?

+2


a source to share


2 answers


Use the Facebook Like Button generator here:

Facebook Like Button Generator

Paste the generated iframe code into your main page. If you leave it the way it will "like" your site, not specific pages.

To "like" individual pages, you can take the generated code and find a section like this:



src="http://www.facebook.com/plugins/like.php?href=mysite.com&

      

Change it like this:

src="http://www.facebook.com/plugins/like.php?href=<%=Request.Url.ToString() %>&amp;

      

And that should work to "please" each particular page.

+6


a source


You must also add the META property of the generated facebook button as dynamically: use HtmlGenericControl

in the code behind. I wrote a complete article on how to add an asp.net button using master pages: link text



0


a source







All Articles