I have a table that I populate with values from a database.
when someone clicks on these values it fires a client side event that I
added to the cells of the table during building of the table with the
Attributes.Add method.
this works ok, But what I would really like to do is add a server side click
event to the table or cells so I can add more data to the page without
refreshing. I would also have to know what cell was clicked.
how do I do this?
Hi,
> I have a table that I populate with values from a database.
> when someone clicks on these values it fires a client side event that I
[quoted text clipped - 3 lines]
> event to the table or cells so I can add more data to the page without
> refreshing.
if you want to do that without refreshing you'll have to do it on the
client-side, that is, by using i.e. JavaScript.
> I would also have to know what cell was clicked.
If you're using an ASP-table, add some JS-code to the cell's
<onclick>-event where it passes its ClientID to a JS-function via code or,
if you're using an HTML-table, do so at design-time.
This way your function may handle i.e. the backcolor of the cell that was
clicked via document.getElementById.
Cheers,
Olaf

Signature
My .02: www.Resources.IntuiDev.com
Slim - 29 Dec 2006 03:42 GMT
> Hi,
>
[quoted text clipped - 20 lines]
> Cheers,
> Olaf
I have done the job client side, but I really want to do it serverside, when
I say server side I mean with a asp.net event like a asp:button. I could
include a asp button in each cell, but I thought there must be a simpler way
of doing it
> My .02: www.Resources.IntuiDev.com
Olaf Rabbachin - 30 Dec 2006 12:46 GMT
Hi,
> I have done the job client side, but I really want to do it serverside, when
> I say server side I mean with a asp.net event like a asp:button. I could
> include a asp button in each cell, but I thought there must be a simpler way
> of doing it
if you want to do it server-side, then adding a server-side event would be
the simplest approach. If you'd actually like to check things on the
client-side before actually posting back to the server (and your checkups
may not be solved using validator-controls), then use some JavaScript to do
your checkups on the client-side and, if appropriate, post back to the
server. ASP.Net will always create the __doPostBack-handler in the
resulting HTML-files - you could utilize that function to do your own
JS-handled postback.
Cheers,
Olaf