ASP 网页中的堆栈跟踪错误不在我的代码中?

发布于 2024-08-25 19:37:59 字数 371 浏览 3 评论 0原文

我是 ASP 中的 Web 开发新手,我遇到了一个问题,我尝试通过链接访问某个页面,但出现错误,第一部分说这是一个异常,然后是调试提示,然后是堆栈跟踪

发生的情况是,这段代码不在我的应用程序中,我以前也遇到过这样的错误,而出现的代码的平静通常对我有很大帮助。

--[编辑1]--
戴夫·安德森 (Dave Anderson):(

Format(Eval("Data"),"dd/MM/yyyy")

在标签内)

I'm new to web-development in ASP, and I'm experiencing a problem where I try to access a certain page through a link and I get an error, the first part says it's an exception, then tips on debugging and then the stacktrace.

What happens is that this code isn't on my application, I've had errors like this before, and the peace of code that appeared usually helped me a lot.

--[EDIT 1]--
for Dave Anderson:

Format(Eval("Data"),"dd/MM/yyyy")

(inside a label)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

等风也等你 2024-09-01 19:38:00

堆栈跟踪的前两行应该会给您一些提示。第二行显示 ASP.PMUsControl 的实例正在尝试绑定到某些数据集,其格式应用于第一行的字符串值。该表达式无效,我想是因为它无法格式化,我想说这是因为字符串为空或对象无法转换为字符串。您能找到它试图绑定的数据吗?

编辑:该格式字符串“dd/MM/yyyy”用于日期对象,所以我不认为Eval(“Data”) code> 可以返回有效的日期格式。尝试删除 Format 函数并只保留 Eval("Data"),如果页面加载,您将看到它尝试用作日期的内容。有关背景信息,请参阅日期和时间时间格式字符串

The first two lines of the stack trace should give you some hint. The 2nd line shows that an instance of the ASP.PMUsControl is attempting to bind to some set of data with a format being applied to a string value on the 1st line. That Expression is not valid which I suppose is because it can't be formatted and I would say that's because the string is null or the object can't be converted to a string. Can you find the data it is trying to bind to?

EDIT: That format string "dd/MM/yyyy" is for use with a Date object so I don't think Eval("Data") can be returning a valid Date to format. Try removing the Format function and just leave Eval("Data") and if the page loads you'll get to see what it tried to use as a date. For background see Date & Time Format Strings

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