Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2006

Tip: Looking for answers? Try searching our database.

Table Events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Slim - 28 Dec 2006 17:56 GMT
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?
Olaf Rabbachin - 28 Dec 2006 18:38 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.