Formatting DataBinder.Eval data

后端 未结 10 1140
眼角桃花
眼角桃花 2020-12-08 04:33

How can I format data coming from a DataBinder.Eval statement in an ASPX page?

For example, I want to display the published date of the news items in a particular fo

10条回答
  •  渐次进展
    2020-12-08 05:24

    There is an optional overload for DataBinder.Eval to supply formatting:

    <%# DataBinder.Eval(Container.DataItem, "expression"[, "format"]) %>
    

    The format parameter is a String value, using the value placeholder replacement syntax (called composite formatting) like this:

    
    

提交回复
热议问题