Reputation: 3774
I have a checkbox
in datalist
, after the button is clicked(postback
) the value of checkbox is cleared. For example, if the checkbox
in datalist
is checked, when the button is clicked the checkbox appears unchecked when getting it's value
Upvotes: 0
Views: 3826
Reputation: 7539
I bet that you are binding your DataList incorrectly.
You need to check if Not Page.IsPostBack, and bind in there. Otherwise, you are binding every postback and resetting all values.
Upvotes: 0
Reputation: 4882
Try this:
Put your databinding code in Page load inside
If (!IsPostBack)
{
//Bind Data
}
Upvotes: 1