I am creating facebook comment box,it works fine with the static urls, but my url contains the query string parameters with it like this: http://bugnull.com/article_content.aspx?id=19&title=code+testing.
I want to have the different comments for each unique url.
Here is the code I am using :
Code just after the body tag:
<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_US/all.js#xfbml=1&appId=XXXXXXXXXXX";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));</script>
**and code for the comment box:**
<div class="fb-comments" data-href="http://bugnull.com/article_content.aspx?id=(.*)&title=(.*)" data-num-posts="2" data-width="500"></div>
Here I want to change the url such that the above url is manipulated such that it allows me to have unique comment thread for each unique page.
I found the solution which was quite fascinating,here is the manipulation in the code required:
In the div tag :
I included runat=”server” and in aspx.cs it was accessible: