events for controls in a Table server control

Discussion in 'ASP .Net' started by Mark, Jul 20, 2004.

  1. Mark

    Mark Guest

    I have a Table server control with several link buttons. How do I generate
    the click events for each of these controls? I can't double click on them
    or go into the properties of the linkbuttons to generate the event like I
    usually do using VS.NET and C#. I could explicitly type out the event
    handler into the InitializeComponent() method, but that usually makes VS.NET
    freak out down the line when I start messing with the web designer generated
    code.

    Suggestions? See the .aspx code below.

    <asp:Table id="Table2" runat="server">
    <asp:TableRow>
    <asp:TableCell>
    <asp:LinkButton runat="server" ID="lnkSomeLinkButton">My link
    button</asp:LinkButton>
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>

    Thanks in advance.
    Mark
    Mark, Jul 20, 2004
    #1
    1. Advertising

  2. "Mark" <> wrote in message
    news:...
    > I have a Table server control with several link buttons. How do I

    generate
    > the click events for each of these controls? I can't double click on them
    > or go into the properties of the linkbuttons to generate the event like I
    > usually do using VS.NET and C#. I could explicitly type out the event
    > handler into the InitializeComponent() method, but that usually makes

    VS.NET
    > freak out down the line when I start messing with the web designer

    generated
    > code.
    >
    > Suggestions? See the .aspx code below.
    >
    > <asp:Table id="Table2" runat="server">
    > <asp:TableRow>
    > <asp:TableCell>
    > <asp:LinkButton runat="server" ID="lnkSomeLinkButton">My link
    > button</asp:LinkButton>
    > </asp:TableCell>
    > </asp:TableRow>
    > </asp:Table>


    You can add something like this:

    lnkSomeLinkButton.Click += new EventHandler(lnkSomeLinkButton_Click);

    after the base.OnInit(e); call in OnInit.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jul 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dakota2030
    Replies:
    0
    Views:
    478
    Dakota2030
    Mar 11, 2005
  2. newbye
    Replies:
    0
    Views:
    573
    newbye
    Jul 6, 2006
  3. SevDer
    Replies:
    2
    Views:
    1,286
    Walter Wang [MSFT]
    Nov 13, 2007
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    340
    Chris
    Aug 30, 2005
  5. Jim Gilligan
    Replies:
    0
    Views:
    153
    Jim Gilligan
    Sep 1, 2005
Loading...

Share This Page