Groups | Blog | Home
all groups > asp.net datagrid control > november 2004 >

asp.net datagrid control : JavaScript Onclick firing a button (C#)


Jer
11/28/2004 11:27:44 PM
Has anybody ever used JavaScript to fire a button? I want a user to be able
to click anywhere in a row to be able to make a selection. I use mouseovers
and mouseouts to highlight the selected row. Currently the only way I know
how to allow a user to click anywhere on a row is to register a JavaScript
OnClick script which redirects back to the same page with a specified
querystring (like an id). I don't want to use querystrings within the same
page though.

J

Eliyahu Goldin
11/29/2004 10:32:52 AM
On server side use either ItemDataBound or PreRender event to set the same
javascript handler for "onclick" client event to all cells in the same row.
Pass the row key value to the handler. It is not clear what sort of button
you want to fire and what for.

Eliyahu

[quoted text, click to view]

Alan Z. Scharf
11/29/2004 3:00:45 PM
Is this what you are looking for?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchTopQuestionsAboutASPNETDataGridServerControl.asp#

Alan

[quoted text, click to view]

AddThis Social Bookmark Button