Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
OnClientClick Event inside LinkButton within a Repeater does not fire from Bootstrap popover

I am using Javascript to handle a Bootstrap popover, but the Javascript inside the LinkButton (which is inside a repeater) doesn't fire. I think it has something to do with the way I setup the Javascript for the popover. I would appreciate some help!

Markup

     <div class="dropdown">
            <button class="btn btn-secondary dropdown-toggle" id="ProjectCardButton" type="button" data-toggle="popover">
                Project Dropdown (WIP)
            </button>
            <div class="ProfilePopupModal col-md-4 clearfix d-md-block" id="ProjectCard">
                <div class="card mb-2">
                    <div class="card-body" style="width: 200px; padding-left: 0 !important;">
                        <div class="row">
                            <div class="col-lg">
                                <asp:Repeater ID="projectDropdown" runat="server">
                                    <ItemTemplate>
                                            <asp:LinkButton runat="server" Text="Link button" OnClientClick="selectProject() {alert('You pressed Me!');}; return false;" />
                                        </br>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

Javascript

var options = {
   html: true,
   placement: 'bottom',
   content: function () {
   return $('#ProjectCard').html();
     }
 }

$("#ProjectCardButton").popover(options);

CSS

.ProfilePopupModal {
    visibility: hidden;
    position: fixed;
    overflow-x: hidden;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I was able to figure it out thanks to shrewmouse on stackoverflow. His answer can be found here: link

I had to change the popover content in my javascript so that it includes the dynamically binded data. I did this by removing .html().

Previously I was only returning the html of my popover content which was why the links weren't working. The other code above and below the popover (as shown below) are meant to handle the hiding and showing of the popover content itself that lives in the DOM.

          $("#ProjectCard").hide();

          $('#ProjectCardButton').popover({
              html: true,
              placement: 'bottom',
              container: '.bootstrap-iso',
              content: $('#ProjectCard')
           });

          $('#ProjectCardButton').popover('show');
          $('#ProjectCardButton').popover('hide');

          $("#ProjectCard").show();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!