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

前端 未结 3 2115
孤城傲影
孤城傲影 2021-02-10 14:50

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:20

    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.

提交回复
热议问题