Hi,
I have a ChkBox in Repeater control as below:=
<asp:Repeater ID="UsersRoleList" runat="server">
<ItemTemplate>
<asp:CheckBox runat="server" ID="RoleCheckBox" AutoPostBack="true" Text='<%# Container.DataItem %>' OnCheckedChanged="RoleCheckBox_CheckChanged" />
<br />
</ItemTemplate>
</asp:Repeater>
And onCheck of ChkBox item ,below event is fired.
protected void RoleCheckBox_CheckChanged(object sender, EventArgs e)
{
//Chked Role is added to DB.
Roles.AddUserToRole(selectedUserName, roleName);
}
But I want this event to fire on Click of some Button.
Can I use DELEGATE to achieve this??
Please modify below coding...
//Declaring delegate
public delegate void UpdateUserRole(object sender, EventArgs e);
// Instantiation
UpdateUserRole MyDelegate = new UpdateUserRole(RoleCheckBox_CheckChanged);
// Invocation
MyDelegate();
Thanks in advance...