469,578 Members | 1,869 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

Setting events for button within asp:table

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
Nov 18 '05 #1
2 2489
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 ableto 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:buttonworking.

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

How can I set the click event for my button using this method?
Thanks,
Kevin
.

Nov 18 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
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
.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Marty McDonald | last post: by
4 posts views Thread by coleenholley | last post: by
1 post views Thread by Ed West | last post: by
4 posts views Thread by Nathan Sokalski | last post: by
2 posts views Thread by Sue | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.