会不会是控件类型不匹配错误造成的。也有一种可能是你自定义模板列,然后用FindControl所指定的控件错误

解决方案 »

  1.   

    Label myLabel=(Label)FormView1.FindControl("InfoIDLabel1");
    不存在,或者你ID名字写错了
      

  2.   

    为什么写在FormView1_ModeChanging事件里,可能这个事件触发的时候,里面的控件还没加上去。
      

  3.   

    寫在 FormView1_DataBound 事件中...在FormView1_ModeChanging事件中還沒有create出來..         Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound        If FormView1.CurrentMode = FormViewMode.Insert
             {
             Label myLabel=(Label)FormView1.FindControl("InfoIDLabel1");
             myLabel.Enabled = true;
             }
      

  4.   

    怎么想到放ModeChanging事件中.你的控件是那个MODE下的?
      

  5.   

    我是想在转换到更新模式时,取到某些控件,然后编辑他们的属性?
    难道不是写到ModeChanging事件中?