Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
iam creating one application where i want to show comment which user giving for that i just think use facebook comment box but iam not getting how can i add facebook comment box in my asp.net3.5 what is step i can use? your all expert advice is useful for me
Posted

Facebook comments box is a social plugin provided by facebook. In order to implement that, you need to perform the following steps:-

Go to the following URL:-

https://developers.facebook.com/docs/plugins/comments


Fill the form, and click on the button named "Get Code".

Clicking on this button will give you a code. Copy that code and paste it in your page. This is also usually a step which can be broken in two steps:-

1) Paste the javascript SDK on your page in the body tag. This code is given below:-

XML
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3&appId=751348078240642";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


Step 2).
Add the following Code where you want comment box to appear:-

<div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-numposts="5" data-colorscheme="light"></div>


Please Note following:-

There is an data-href attribute in the code which is pasted in step 2. You need to replace the value of data-href with the URL of the page where you have added comment box.

I am giving an example of Step 2 on MVC View where I have used the Comment box.

<div class="fb-comments" data-href="@Request.Url.ToString()" data-numposts="5" data-colorscheme="light"></div>


You can see that I have replaced the value of the data-href attribute at run time with the actual URL of the page.
 
Share this answer
 
v2
i got my own answer :)


<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
paste above code within body


paste this code whenever u want
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900