views:

390

answers:

0

I have a checkbox in a repeater and it is bound to a data source where it sets the checkbox to checked or unchecked. The checkbox is set to AutoPostBack and has an OnCheckedChange event.

The problem is that the event keeps getting fired when the page loads. I need it to only fire if the user makes a change. How do I do this?

        protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["adminID"] != null)
        {
            if (!IsPostBack)
            {
                List<Search_admin> searchList = SearchDB.GetAllSearches();
                searchRepeater.DataSource = searchList.ToArray();
                searchRepeater.ItemDataBound += new RepeaterItemEventHandler(activeCkBx_click);
                searchRepeater.DataBind();
            }

        }
        else
            FormsAuthentication.RedirectToLoginPage();
    }

    protected void activeCkBx_click(object sender, EventArgs e)
    {

    }

thanks