Datagrid Link Button
-
I am using ItemDataBound event to add a Link button to a column using following code
LinkButton temp = new LinkButton(); temp.Click += new EventHandler(xyz); temp.ID = e.Item.Cells\[i\].Text; temp.CommandArgument = e.Item.Cells\[i\].Text; temp.Text = e.Item.Cells\[i\].Text;
now when page is displayed i see these buttons but when i click on them, page is refreshed but Click event is not raised. how can i see which event control and which event is raised when i am clicking this link.
Regards Shajeel
-
I am using ItemDataBound event to add a Link button to a column using following code
LinkButton temp = new LinkButton(); temp.Click += new EventHandler(xyz); temp.ID = e.Item.Cells\[i\].Text; temp.CommandArgument = e.Item.Cells\[i\].Text; temp.Text = e.Item.Cells\[i\].Text;
now when page is displayed i see these buttons but when i click on them, page is refreshed but Click event is not raised. how can i see which event control and which event is raised when i am clicking this link.
Regards Shajeel
-
when u click it only page_load raised. i think that you'r plused event is null or empty. if u add your event in page load each time there will be right.
sepel
-
no its not null, i have a break point int the function but it is not fired.
Regards Shajeel
-
yes it raised but only page load is raised itrace some problem. i add javascript to my buttons. i hope u siolve it.
sepel