谁能告诉我如何对 GridView BoundField 对象进行子字符串化吗?
到目前为止我已经尝试过了,但还没有成功。谢谢。
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ChopString((string)Eval("description")) %>'></asp:Label>
</ItemTemplate>
最佳答案
您需要使用子字符串。
Eval("description").ToString().Substring(0,60)
我相信这就是您所需要的。
关于c# - "Substring"GridView BoundField 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11088633/