This is a migrated thread and some comments may be shown as answers.

Not able to add attribute on page OnInit

1 Answer 75 Views
Button
This is a migrated thread and some comments may be shown as answers.
Joby
Top achievements
Rank 1
Joby asked on 20 Nov 2012, 12:02 PM

Hi,
  I have a radbutton with the name "rbtnDelete".Here i am trying to register below code on page OnInit method 

ClientScript.RegisterClientScriptBlock(this.GetType(),
"ConfirmDelete", objUtl.RadConfirmDelete(),true);
this.rbtnDelete.Attributes.Add("OnClientClicking",
"function(sender,args){ConfirmDelete(sender, args, 'dgvContactList',
'hidContactRowCount');}");

.But it is not working. But if i try to use in aspx with this code it is working fine 

 OnClientClicking="function(sender,args){ConfirmDelete(sender,args,'dgvContactList','hidContactRowCount');}"


Please help me

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 20 Nov 2012, 09:44 PM
Hey Joby,

In your first example, why are you setting the OnClientClicking event using the Attributes collection, instead of setting the property directly on the control. This is how I would do it.
this.rbtnDelete.OnClientClicking = ".....";

I hope that helps.
Tags
Button
Asked by
Joby
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or