CheckBoxList is not firing when uncheck last item in Formview Edit Mode
CheckBoxList don't fire under the following condition
- CheckBoxList has been set to AutoPostBack.
- It fired When checked or unchecked with at least one item left checked.
- It didn't fired w开发者_如何学JAVAhen unchecked and no single checked item left.
- it is wrapped in update panel condition mode set to alway.
Question: Is there anyway to make it fire under these conditions ?
Edit 1 Add More Information
- I have test on blank project, both on update panel and outside updatepanel work
- I have realized that checkboxlist is put on FormView in EditMode too, this might be the cause of error
- I have tried moving checkboxlist outside of formview and it worked fined now, i have to figure out how to make it works outside formview too.
After struggling to find a real solution, I have given up and came up with the following workaround.
I have use jquery to force postback"
$("#cblRoomType").live('click',
function ForcePostBack()
{
__doPostBack('<%= cblRoomType.ClientID %>', '');
}
);
Then i have set an event on Page_Load instead.
protected void Page_Load(object sender, EventArgs e)
{
if (Master.ScriptManager.AsyncPostBackSourceElementID == cblRoomType.ClientID)
{
RefreshPromotionRoomType();
}
// Other Code
}
精彩评论