473,507 Members | 3,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2646
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2148
by: Stephen | last post by:
I have got the below asp table and I would like to be able to call up the lblAddress1 label with in the asp table in the code behind page. I tried doing this.lblAddress1 and it didn't work and I...
3
11994
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
4
1931
by: coleenholley | last post by:
I asked the question yesterday: > HI All :-) > > I don't know if I will be able to do this type of formatting, but what I > need to do is have a table row where the text wraps (This is easy)...
4
1577
by: stb | last post by:
I have an empty asp:table on a form. Rows and cells in the rows are added programatically. At the end of each row, there is a cell with a button inside it. How do I catch the button's click...
1
12219
by: Ed West | last post by:
Hello, How can I put a textbox control into a cell of an asp:Table? I was not able to do it from the properties sheet, so I put it in via html tab, but now I can't select it from the Design tab...
8
3868
by: tatemononai | last post by:
I had a beautiful script that was running, well, just beautifully. But then I decided to take a button that fired an event and place it inside a <asp:table. The event WILL NOT FIRE INSIDE THE...
4
3918
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
2
1264
by: Sue | last post by:
Is there a way to add comments on the HTML page within an ASP:Table? (ever try and use "comments" as a search word <g>?) tia, Sue
1
1115
by: jonnyboy26 | last post by:
I have a dynamically populated ASP table. One of the columns in every row is a checkbox. I want the user to be able to check a few of the boxes, then hit the 'update' button. Thus marking the records...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.