Click here to Skip to main content
13,092,862 members (95,965 online)
Rate this:
Please Sign up or sign in to vote.
See more:
                        <ul class="ul-Clinical" style="margin-removed 5px;">
                            <asp:Repeater ID="rptAllMembers" runat="server">
                                    <li class="ul_Clinical_li1" style="margin-removed 10px; margin-removed 15px; border: 1px solid #ccc;
                                        width: 100px; height: 100px;"  önclick="clickshowtick('<%# Eval("TherapistStaffID") %>')">
                                        <div id='<%# Eval("TherapistStaffID") %>' class="">
                                        <img src="../images/Avatar.png" alt="TimeSheet" style="width: 50px;" /><br />
                                        <asp:Label ID="lblUsername" runat="server" ToolTip='<%# Eval("FirstName") + " " + Eval("LastName") %>'
                                            Text='<%# Eval("FirstName") + " " + Eval("LastName") %>'></asp:Label>

This is my for repeater i am implementing the tick class on it of jquery.and getting id from my eval id='<%# Eval("TherapistStaffID") %>'

<div class="DivGeneral">
                                <asp:Label ID="lblSearch" runat="server" Text="Search:" Width="50px"></asp:Label>
                                <asp:TextBox ID="txtSearch" runat="server" CssClass="sf" Width="423px">
                                <%--Hidden Field--%>
                                <asp:HiddenField ID="hfSelectedMembeID" runat="server" Value="" />

this my hidden field in which i want to put my repeater id.

function clickshowtick(tckclass) {
            if ($('#' + tckclass).hasClass("tick_img"))
                $('#' + tckclass).removeClass("tick_img");
                $('#' + tckclass).addClass("tick_img");
            $("#<%=hfSelectedMembeID.ClientID %>").val(tckclass);
            var str;
            str = $("#<%=hfSelectedMembeID.ClientID %>").val(tckclass) + ',' + tckclass }

this is my javascript code at the top of my design class.

here is a problem that i dont know how to get the id from repeater link button on click.and after that how to put it in hidden field

and after that how can i get it at code behind.
at last how to store it in database.

please help me.

Posted 2-Jan-13 0:51am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


So your problem is you cant get any unique identification while user click or any other operation on that particular row.

You can achieve it using several way, but don't use hidden fields its not a secure.

before binding you can bind your auto generated id with that grid view but that column should be invisible.


you can directly bind DB identity filed to that grid.


Create one GUID for each row and on click asynchronously send that GUID to sever and depending on that check your data. put that GUID to a custom attribute of TR and you can get it via JQuery or javascript * recommended


if your table is not sort able then you will get row index in javascript and that row index is equals to your datatables row index at server. send that index to server. (IF you not using paging) * Not recommended

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100