我的 Gridview 中的 DataFormatString 在 SharePoint 中不起作用
我有一个通过 SharePoint Designer 2007 在页面上创建的 ASP.NET GridView。 由于某种原因它不想工作,为什么会这样以及我该如何修复它?
有趣的是,它可以在另一台 SharePoint Server 上运行,但不能在我现在正在使用的 SharePoint Server 上运行,所以我知道我的代码没问题,它可能是 SharePoint Server 上的问题?
我的货币数据格式字符串也不想在我当前的 SharePoint Server 上工作。
我的日期字段的 DataFormatString
<asp:BoundField DataField="c505_remdate" HeaderText="Remit. Advice Date"
SortExpression="c505_remdate" DataFormatString="{0:d/MM/yyyy}" />
I have a ASP.NET GridView that i created on a page through SharePoint Designer 2007.
For some reason it just does not want to work, why is that and how can i Fix it?
Funny thing, it worked on another SharePoint Server but not on the one i am working on now, so i know my code is fine, it must be something ells on the SharePoint Server maybe?
My Currency DataFormatStrings also dont want to work on my current SharePoint Server.
My DataFormatString for my Date field
<asp:BoundField DataField="c505_remdate" HeaderText="Remit. Advice Date"
SortExpression="c505_remdate" DataFormatString="{0:d/MM/yyyy}" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您尝试查看页面时,日志中是否会弹出任何内容? 加载时是否只是出现空白页? 只是缺少网格视图吗? 更多细节可能有助于发现问题。
如果 HtmlEncode 设置为 true,数据格式字符串可能会变得不稳定。 请参阅此处“备注”下的第一个注释:
system.web.ui.webcontrols.boundfield.dataformatstring
Does anything pop up in the log when you try and view your page? Do you just get a blank page when loading? Is it just the grid view that's missing? A little more detail might help uncover the problem.
Data format strings might get wonky if HtmlEncode is set to true. See the first note under "Remarks" here:
system.web.ui.webcontrols.boundfield.dataformatstring
在字段中设置 htmlencode="False" 属性并修复它。
去搞清楚
set the htmlencode="False" atribute in the field and that fixes it.
go figure