我的 Gridview 中的 DataFormatString 在 SharePoint 中不起作用

发布于 2024-07-19 06:05:45 字数 479 浏览 7 评论 0原文

我有一个通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

动听の歌 2024-07-26 06:05:45

当您尝试查看页面时,日志中是否会弹出任何内容? 加载时是否只是出现空白页? 只是缺少网格视图吗? 更多细节可能有助于发现问题。

如果 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

红颜悴 2024-07-26 06:05:45

在字段中设置 htmlencode="False" 属性并修复它。
去搞清楚

set the htmlencode="False" atribute in the field and that fixes it.
go figure

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文