473,568 Members | 2,882 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 2658
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*******@disc ussions.microso ft.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
2151
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 tried doing this.tblSearchAddresses.lblAddress1 and it didn't work. Has anyone an idea how I call this lable with a asp table. Thanks in advance for...
3
12002
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 DataTable, then I discovered the asp:Table has a DataBind method. But the method takes no args and so I'm confused how to use it. Is there a link to see...
4
1937
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) the first > line of text is font size 10 pt and the second (wrapped text) is 6 pt. I > know how to create a style sheet to get all of my font one...
4
1584
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 event? dim dr as sqlDataReader Dim tempCell As TableCell dr=........
1
12236
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 (nor select it from the Properties tab on the right). Any ideas? <asp:Table id="Table1" runat="server"> <asp:TableRow> <asp:TableCell...
8
3872
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 TABLE!?! When I move the button outside the table, it works just fine. Inside the table, it doesn't. What gives?
4
3926
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 the element outside of the table and then using cut & paste in HTML View to move it to the desired location, or by manually typing the code in using...
2
1267
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
1125
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 as done and removing them from the list. The problem I am having is that when the update button is clicked, it does a postback and the data in the...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2101
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 we have to send another system

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.