What's a good way to set the Item or DataSource attribute of a FieldRenderer?

前端 未结 3 697
深忆病人
深忆病人 2021-02-10 14:52

The scenario is that I have a lot of FieldRenderers. These should output data from various places, some from item X and others from item Y. And should be outputting properties f

3条回答
  •  半阙折子戏
    2021-02-10 15:33

    If you have a lot of FieldRenderer controls and you want to contain the logic inside the markup then you can use the <%# ... %> expression and just call this.DataBind(); at the end of Page.Load. That will then bind all the controls inside your usercontrol.

提交回复
热议问题