472,348 Members | 1,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

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 2570
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
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...
3
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...
4
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...
4
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...
1
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...
8
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...
4
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...
2
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
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...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

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.