Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have to perform, checkbox checked event on button click event.checkbox is on repeater.i will do following code but it gives error.(object reference not set instans of object)

What I have tried:

C#
protected void btnsave_Click(object sender, EventArgs e)
    {
        foreach (RepeaterItem item in rptr.Items)
        {
            if (((CheckBox)item.FindControl("Checkbox1")).Checked)
            {
                
            }
        }
    }
Posted
Updated 4-Jul-17 20:05pm

1 solution

No one can answer this question without seeing and running your whole code, use the debugger and check the value of the variables on the line that fails to see which of them is null then solve the reason why.
 
Share this answer
 

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