现在的位置: 首页 > 综合 > 正文

ComponentArt Web.UI控件的bug及解决办法

2013年06月13日 ⁄ 综合 ⁄ 共 663字 ⁄ 字号 评论关闭

在使用ComponentArt Web.UI 2.0.1983控件的过程中,如果Web.UI控件的EnableViewState在ASPX页面中设置为False(也就是在VS.NET设计器中设置属性),就会发现DataGrid控件的PageIndexChanged事件和DeleteCommand等由_doPostback触发的相关事件都不能被触发,而且PostBack以后DataGrid上的数据会丢失(即使ViewState设置为True也没有用)。

解决办法如下,或者见ComponentArt Knowledge Base Q10048

Workarounds

There are a couple of workarounds for this problem:

 

1. Enable viewstate for the Web.UI control.

 2. Instead of disabling viewstate in the control tag with EnableViewState="false", disable it in Page_Load:

  • Remove the assignment EnableViewState="false" from the control tag in the .aspx page;
  • Set the property in the Page load phase:

    private void Page_Load(object sender, System.EventArgs e)
    {
      Menu1.EnableViewState = false;

      ...
    }

抱歉!评论已关闭.