click event not triggered

S

samuelberthelot

Hi,
I have a linkbutton in a template column of my datagrid.
I've done the following to add event to each of the button in the grid:

For Each dgi As DataGridItem In GridView2.Items
AddHandler CType(dgi.FindControl("QueryGroupName"),
LinkButton).Click, AddressOf somefunction
Next

Public Sub somefunction(ByVal sender As Object, ByVal e As
System.EventArgs)
stop
End Sub

Note : The page is the child page of a Master page.
The event is never triggered. Why ?
 
S

samuelberthelot

I've noticed that when I look at the source in my browser, the control
was renamed to:

ctl00_ReportWizard_GridView2_ctl03_QueryGroupName !!
This is so weird.
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top