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

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

I have a 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
but putting querystring component 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=' '  data-send='true' data-width='450' data-show-faces='true'></div>";
any ideas?

Question by:johngrant_ks
    LVL 19

    Expert Comment

    by:Manoj Patil
    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
    Try this

    "<div class='fb-like' 
    data-href='<%# uniqueID %>'
    data-send='true' data-width='450' data-show-faces='true'></div>";

    Open in new window


    Accepted Solution

    I solved the problem by placing an & symbol at the end of my query string


    this seems to fix the problem

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

    Author Closing Comment

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

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    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…
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now