none
Accessing display template controls from a web part RRS feed

  • Question

  • I customized search display template to include a checkbox for every search result. Those are plain old HTML checkboxes. What is the best way to access those controls from within a web part? I need to identify which checkboxes are checked and grab the result title from those items and pass them on for server-side processing.

    Any suggestions?

    Thanks!

    Wednesday, February 22, 2017 9:47 PM

Answers

  • Hi,

    If the checkboxes just HTML code(not ASP.NET controls), we can use the jQuery to get the checkboxes checked and grab the results title, then customize a web service in server-side, and send the data using jQuery Ajax to the server-side.

    If you don't want to use web service, we can use a input hidden control to store the data, then get this control value form the code-behind.

    <input type="hidden" runat="server" id="xxx">

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Thursday, February 23, 2017 7:08 AM
    Moderator