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 / February 2008

Tip: Looking for answers? Try searching our database.

Server Click in table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Zopers - 11 Feb 2008 14:42 GMT
Hello,

I would like to know if it is possible to use a ServerClick event on a
tablerow. I have a HTML table and I would like to handle an event on the
server when the user clicks on a row in the table.

I could use the GridView, but then I have to add a new Select column and
I don't want a new column for selecting a row. A user should be able to
click on any column in the row to fire the event on the server (not a
javascript function).

Greetings,
Chris
Eliyahu Goldin - 11 Feb 2008 14:52 GMT
Go ahead and add a Select column as the first column in the grid. Hide the
Select column with Visible=false. Handle RowDataBound event and run this
code for every data row:

e.Row.Attributes["onclick"] = this.GetPostBackEventReference
(e.Row.Cells[0].Controls[0]);

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> Hello,
>
[quoted text clipped - 11 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***

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.