Custom onClick for paging buttons

L

lilfos

I've tried my darnedest to add a function call to the onclick event of
a datagrid's numeric page buttons, but to no avail. I have added to
the onclick event of other controls by adding an attribute in the code
behind during initialization and by using javascript to loop through
each control in a form and add to the onclick event of the controls
whose name match certain criteria (this is useful when you have
controls generated for each row of a datagrid).

Unfortunately, the page links are not controls. They are anchor tags
that call _doPostBack. I tried looping through each link in
document.links, but this only returned the text of each link (e.g. the
page number). I couldn't get this into the form of an link object so
that I could set and get its properties.

DataGrid1.PagerStyle has an AddAttributesToRender method, but it does
not seem to work and it is not documented.

Does anyone know if/how I can add to the page links' href or onclick
attributes? I need some client-side script to execute before unload, so
handling the event in the code behind won't work for me.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top