Facebook like button is not displaying if the href has a dynamic conponent

Posted on 2012-09-09
Medium Priority
Last Modified: 2012-09-16

I have a asp.net page with a repeater list on it containing Facebook like buttons.
The like buttons render ok in the repeater items if the href on all the like buttons are the same in all of the items, but if I place a query string component in the href it will only show the last item in the repeater.
e.g. the URL that will render the controls properly http://www.mysite.com/asppage.aspx
but putting querystring component http://www.mysite.com/asppage.aspx?querystring=uniqueID where unique id is unique number in each repeater list item
I have followed all of the facebook guides but nothing fixed this issue
I’m using the HTML5 version of the facebook like button
lblFaceBookLikeButton.Text = "<div class='fb-like' data-href='http://www.mysite.com/asppage.aspx?querystring=uniqueID '  data-send='true' data-width='450' data-show-faces='true'></div>";
any ideas?

Question by:johngrant_ks
  • 2
  • 2
LVL 19

Expert Comment

by:Manoj Patil
ID: 38384674
Can you put the piece of code of your repeater control.. where you are going to add like button ?
LVL 19

Expert Comment

by:Manoj Patil
ID: 38384756
Try this

"<div class='fb-like' 
data-href='http://www.mysite.com/asppage.aspx?querystring=<%# uniqueID %>'
data-send='true' data-width='450' data-show-faces='true'></div>";

Open in new window


Accepted Solution

johngrant_ks earned 0 total points
ID: 38389605
I solved the problem by placing an & symbol at the end of my query string

e.g. http://www.mysite.com/mypage.aspx?uniqueID=21&

this seems to fix the problem

Feels like a bit of a work around hopefully it helps someone else.

Author Closing Comment

ID: 38402956
It was the best solution to the problem thanks for posting your answers

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, you will learn how to create custom audiences using your own email lists. You can use this custom audience as your target audience for advertising on Facebook. This allows you to advertise to your existing audience. Once you've crea…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 6 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question