如果用了Databinding,就不用管,会自动更新的
如果没有Databinding,那只好先找到这个控件,取出值来
Text text = (Text)fvData.FindControl("CustomerControlID");
text.Text……

解决方案 »

  1.   

    上面这位朋友,可以说的具体些吗?
    我用的绑定方法是指定SqlDataSourceId。
    用findControl是一个解法,但我Formview中Control太多了,有100多个,用FindControl会写太多的代码!
    Databinding我还没用过。我只用过DataBind(),是在指定FormView的DataSource后再调用~~
    请指教,谢谢:)如果可以举个例子也行,如何用DataBinding
      

  2.   

    编辑模板 -> 选择要绑定的控件 -> 快速提示里有databinding
      

  3.   

    我也指定了Customer Control 的Text属性的DataBindings属性为
    双向绑定如:Bind("PDF"),但还是取不到值,执行UpdateCommand不能更新Customer Control的值,请指教:)
      

  4.   

    “执行UpdateCommand不能更新Customer Control的值”
    这句话是什么意思呢?就是你有一个文本框,这个文本框已经DataBingdings到一个字段,执行UpdateCommend之后不能正确更新?那其他字段都正确更新了么?
      

  5.   

    我在EditItemTemplate里有一些是WEB Customer Control(自定义控件),这些Customer Control已经DataBingdings到一个字段,所以当按下Update按钮时,FormView会自动执行UpdateCommand的Sql语句,但是Customer Control上输入的值并没有更新到数据库,我把customer control改成TextBox 或是Dropdownlist后就可以更新到数据库。
    所以我想微软的Formview在用DataSource绑定时某些操作(如Update)不支持Customer Control。
    谢谢:)
      

  6.   

    估计应该要自己findcontrol然后取到值
    再调用update得方法把值传进去得
      

  7.   

    Click the link to solve your problem.Good luck!