Again, gridview, how to execute a javascript from a ButtonField?

E

Edwin Knoppert

I post this again, no answer before.

During the beta version it worked, the same code does no longer work in the
new release.

I have a simple gridview with ButtonField, the button deletes a records.
So i want to add a confirm in javascript.

How will i set the javascript function (OnClientClick) for this ButtonField?

Before i just did that in the aspx, if i must do it using attributes add
from the page_load.. fine.
But i don't know how to reach the button(s) (button per record of course).
 
E

Edwin Knoppert

Hmm, through the GridView1_RowDataBound() event i was finally able to access
a templateitem's button and generate dynamic javascript, i
needed the record id to delete.
dynamic javascript content was not possible in the template itself (???)

ctrl = e.Row.Cells(0).Controls(1)
b = CType(ctrl, Button)

etc..
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top