开发者

Bind DetailsView field to Function instead of Property

Is it possible to display the result of a function instead of the value of a property in a DetailsView开发者_开发技巧 Field?

For example instead of:

<asp:Label ID="m_LabelPlantCode" runat="server" Text='<%# Bind("PlantCode") %>'></asp:Label>

maybe something like:

<asp:Label ID="m_LabelPlantCode" runat="server" Text='<%# Bind("PlantCode(true)") %>'></asp:Label>


You can do this:

Text='<%# ((YourObject) Container.DataItem).PlantCode(true) %>'


Yes it is possible to bind the result of a function to a field of DetailsView.

Instead of <%# Bind("PlantCode(true)") %>

you could use <%# SomeFunc(Bind("PlantCode") %> and SomeFunc in this case would a server side method accepting args of type PlantCode.

Hope it helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜