iv’e got a list of user controls which i bind to a repeater .
the user control : (Example) “AppProduct”
<div>
<asp:Button ID="btn_details" runat="server" Text="Trigger" />
<asp:HiddenField ID="pid" runat="server" value="5"/>
</div>
the repeater :
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<App:Product ID="P1" runat="server" />
</ItemTemplate>
</asp:Repeater>
the problem :
when i press a certain “btn_details” on a certain user control i need to call a javascript or Jquery function
which does something according to the value of “pid” , but those are the Server Side id’s
how can i get the ClientID for these controls for the user control i clicked on.
i found a work around for this problem
first i set the repeater ClientIDMode:
secondly i added a function to the btn_details on clientClick
in that function i extract the client id for the button and resolved the client id for the hidden field pid
the function which will extract the client id //ContentPlaceHolder1_Repeater1_Prd_2_pid_2: