Setting events for button within asp:table

Discussion in 'ASP .Net' started by Kevin, Dec 9, 2003.

  1. Kevin

    Kevin Guest

    I am just learning asp.net and ran into a problem that I have not been able
    to resolve. I have a web form with an html table that houses an asp:label,
    asp:textbox and asp:button within. I had the click event of the asp:button
    working.

    I then decided to drop an asp:table on the form and then added the three
    component mentioned above into the asp:table. Now I cannot find a way to
    set the click even of the asp:button anymore. In fact, when I attempt to
    select the button in design mode, the entire table becomes selected. I
    cannot seem to select a component within the asp:table.

    How can I set the click event for my button using this method?

    Thanks,
    Kevin
     
    Kevin, Dec 9, 2003
    #1
    1. Advertising

  2. Kevin

    Suresh Guest

    One way to add the event thru HTML code view for the
    button control that inside the asp:table.

    Second(kinda dumb) is to take the control outside of the
    asp:table and attach the onclick event from the design
    mode. Then put the button back in the asp:table.

    Third don't use the asp:table. Just go with regular HTML
    table. If you want server side functionality you can
    always set the HTML table to runat="server".

    HTH,
    Suresh.

    >-----Original Message-----
    >I am just learning asp.net and ran into a problem that I

    have not been able
    >to resolve. I have a web form with an html table that

    houses an asp:label,
    >asp:textbox and asp:button within. I had the click event

    of the asp:button
    >working.
    >
    >I then decided to drop an asp:table on the form and then

    added the three
    >component mentioned above into the asp:table. Now I

    cannot find a way to
    >set the click even of the asp:button anymore. In fact,

    when I attempt to
    >select the button in design mode, the entire table

    becomes selected. I
    >cannot seem to select a component within the asp:table.
    >
    >How can I set the click event for my button using this

    method?
    >
    >Thanks,
    >Kevin
    >
    >
    >.
    >
     
    Suresh, Dec 9, 2003
    #2
    1. Advertising

  3. Kevin

    Kevin Guest

    Thanks for the options Suresh. I thought of the second option, but I have
    experienced strange behavior with Visual Studio 2003 when cutting and
    pasting so I am learing about using this option, especially since other
    developers may have to maintain the code.

    I didn't want to use an HTML table because I couldn't fugure out how to make
    the table visible or invisible progmatically in the code behind.

    Like I mentioned, I am just learning asp (and html coding), but I will
    definately look into how to add the event in the HTML code view.

    Kevin



    "Suresh" <> wrote in message
    news:05a301c3beb0$238b9e60$...
    > One way to add the event thru HTML code view for the
    > button control that inside the asp:table.
    >
    > Second(kinda dumb) is to take the control outside of the
    > asp:table and attach the onclick event from the design
    > mode. Then put the button back in the asp:table.
    >
    > Third don't use the asp:table. Just go with regular HTML
    > table. If you want server side functionality you can
    > always set the HTML table to runat="server".
    >
    > HTH,
    > Suresh.
    >
    > >-----Original Message-----
    > >I am just learning asp.net and ran into a problem that I

    > have not been able
    > >to resolve. I have a web form with an html table that

    > houses an asp:label,
    > >asp:textbox and asp:button within. I had the click event

    > of the asp:button
    > >working.
    > >
    > >I then decided to drop an asp:table on the form and then

    > added the three
    > >component mentioned above into the asp:table. Now I

    > cannot find a way to
    > >set the click even of the asp:button anymore. In fact,

    > when I attempt to
    > >select the button in design mode, the entire table

    > becomes selected. I
    > >cannot seem to select a component within the asp:table.
    > >
    > >How can I set the click event for my button using this

    > method?
    > >
    > >Thanks,
    > >Kevin
    > >
    > >
    > >.
    > >
     
    Kevin, Dec 12, 2003
    #3
    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. Selden McCabe

    Table within a Table - spacing

    Selden McCabe, Jan 14, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    352
    MWells
    Jan 15, 2005
  2. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    425
    Chris
    Aug 30, 2005
  3. Jim Gilligan
    Replies:
    0
    Views:
    175
    Jim Gilligan
    Sep 1, 2005
  4. ESmith

    DropDownList Control within table not firing Events

    ESmith, Oct 19, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    142
    ESmith
    Oct 19, 2005
  5. Targa

    Drag & Drop table within table

    Targa, Oct 7, 2004, in forum: ASP General
    Replies:
    1
    Views:
    223
    Mark Schupp
    Oct 7, 2004
Loading...

Share This Page