FormView.FindControl() returns null until DataBind()

后端 未结 5 2045
轻奢々
轻奢々 2020-12-19 23:24

Why method FindControl() returns null on FormView until call DataBind().

After that it returns everything correct

5条回答
  •  渐次进展
    2020-12-20 00:05

    How would a FormView have any information about its content before it has any data to build it upon?

    So I guess you already answered your own question, you will have to DataBind() before.

提交回复
热议问题