.net Can';即使在数据绑定事件中,也无法在FormView.InsertItemTemplate中找到控件

.net Can';即使在数据绑定事件中,也无法在FormView.InsertItemTemplate中找到控件,.net,asp.net,formview,findcontrol,databound,.net,Asp.net,Formview,Findcontrol,Databound,我的页面标记中有FormView: <asp:FormView ruanat="server" ID="FormView1" DataSourceID="SqlDataSource1" OnDataBinding="FormView1_DataBinding" OnDataBound="FormView1_DataBound"> <InsertItemTemplate> <uc:UserControl1 runat="server" ID="ucU

我的页面标记中有
FormView

<asp:FormView ruanat="server" ID="FormView1" DataSourceID="SqlDataSource1" OnDataBinding="FormView1_DataBinding" OnDataBound="FormView1_DataBound">
   <InsertItemTemplate>
      <uc:UserControl1 runat="server" ID="ucUserControl1" />
   </InsertItemTemplate>
</asp:FormView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" SelectCommand="EXEC someSP" />
变成了

protected void FormView1_DataBound(object sender, EventArgs e)
{
   var c = FormView1.FindControl("ucUserControl1"); // returns null
}
protected void FormView1_DataBinding(object sender, EventArgs e)
{
   FormView1.ChangeMode(FormViewMode.Insert);
}

protected void FormView1_DataBound(object sender, EventArgs e)
{
   if (FormView1.CurrentMode = FormViewMode.Insert)
   {
      var c = FormView1.FindControl("ucUserControl1"); // returns null no more!
   }
}

理论上,我能够在数据绑定后在
FormView
上找到控件。但我不是。为什么?

我的更新代码可以作为一种解决办法吗?或者,改变模式的最佳地点在哪里<代码>数据绑定,
数据绑定
If (FormView1.CurrentMode == FormViewMode.Insert)
      var c = FormView1.FindControl("ucUserControl1");