locked
Asp Repeater problem catching id RRS feed

  • Question

  • User33975896 posted

    Hi all! i'm trying to catch the Button ID  on the code behind and i dont know how because i cant use events on the Repeater. Does anyone knows how can i do that? 

    <asp:Repeater ID="Repeater1" runat="server">

    <HeaderTemplate>

      <asp:Button ID="Pepe" runat="server" Text="Button"/>

    <asp:Button2 ID="Jose" runat="server" Text="Button"/>

    </HeaderTemplate>

    ______________-

    i whant to do a 

    protected sub method_click (sender as object, e as eventargs) ''HANDLES BUTTON.ID'' ( something like that)

    to for example 

    response.writeline ( the ID)

    end sub

    ________________-

      Thanks!!!!   Federico.

    Wednesday, February 6, 2013 7:33 AM

Answers

  • User-1716253493 posted
    use repeater itemcommand instead button click event
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 6, 2013 8:20 AM

All replies

  • User-1360095595 posted

    You can cast the sender parameter to button and then read the id off of that. 

    Wednesday, February 6, 2013 7:47 AM
  • User33975896 posted

    Thanks for your answer!  i write what i 've done trying to solve this  

    ______________________________________________________________ 

    <asp:Button ID="Idiwanttoknow" runat="server" Text="update" OnCommand="pepe" />

    _______________________________________

     Public Sub pepe(ByVal sender As Object, ByVal e As EventArgs)

    if i use sender it shows ''update''

    and i cant use sender.clientid or something like that i think because repeater is private and doesnt have acces or something like that

    if i use sender.doesnt appear propertys 

    end sub

    Wednesday, February 6, 2013 8:19 AM
  • User-1716253493 posted
    use repeater itemcommand instead button click event
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 6, 2013 8:20 AM
  • User33975896 posted

    Thanks  oned_gk! it solve the problem  i wasnt using e.RepeaterCommandEventArgs on the command and using command name 

    Thanks all !! 

    Wednesday, February 6, 2013 8:31 AM