Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:Repeater runat="server" ID="RpUserList">
   <itemtemplate>

    <td>
  <asp:Label ID="lblRpuser_EmpName" runat="server" Text='<%#Eval("EmpName")%>'>

  </td>

  <td>
 <asp:CheckBox ID="Chkuser_Active" Checked='<%#Eval("Active") %>' OnCheckedChanged="Chkuser_Active_CheckedChanged"   AutoPostBack="true" runat="server" />
  </td>

  <td>
 <asp:ImageButton ID="imgevaledit" OnClick="imgevaledit_onclick" Width="16px" Height="16px" ImageUrl="~/App_Themes/SGERP/image/pencil.png" runat="server" />

  </td>
   </itemtemplate>

This is my repeater. My problem is when I click the button(imgevaledit) from the repeater first it fire the 'Chkuser_Active_CheckedChanged' event
and then 'imgevaledit_onclick'.
C#
protected void Chkuser_Active_CheckedChanged(object sender, EventArgs e)
{
    if (sender != null)
    {

    ...............
    }
 }

This is my check event and also I checked 'sender!=null' even though check change if block get executed when button click.
Please help me to solve this issue. And give any idea why checkbox event is fired when button click.
Posted
v2
Comments
Are you changing the Checked State somewhere in code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900