开发者

CheckBoxList is not firing when uncheck last item in Formview Edit Mode

CheckBoxList don't fire under the following condition

  1. CheckBoxList has been set to AutoPostBack.
  2. It fired When checked or unchecked with at least one item left checked.
  3. It didn't fired w开发者_如何学JAVAhen unchecked and no single checked item left.
  4. 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

  1. I have test on blank project, both on update panel and outside updatepanel work
  2. I have realized that checkboxlist is put on FormView in EditMode too, this might be the cause of error
  3. 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
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜