AJAX 面板不抛出异常

发布于 2024-09-02 02:11:42 字数 226 浏览 4 评论 0原文

我刚刚注意到一些 ASP.NET 标记中有些奇怪的东西。

我有一个标准表单,带有几个文本框和一个提交按钮。

单击时,后面的代码将尝试执行一些逻辑,然后返回。

如果输入值无效,则会引发异常。

当我将控件包装在 AJAX 更新面板中并尝试提交错误数据时,没有抛出任何异常,并且面板返回就像没有任何错误一样。

有谁知道如何在保留更新面板的同时将其返回到以前的行为?

i have just noticed something strange in some asp.net markup.

I have a standard form with a couple of textboxes and a submit button.

When clicked the code behind will attempt to perform some logic and then return.

If the input values are not valid it used to throw an exception.

The moment i wrapped the controls in an AJAX update panel and try to submit bad data, no exception is thrown and the panel returns like nothing was wrong.

Does anyone know how to return this to the previous behavior whilst keeping the update panel?

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

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

发布评论

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

评论(1

木槿暧夏七纪年 2024-09-09 02:11:42

它抛出的表达式,但是它是由ajax处理的,现在已经出现了Javascript错误,因为现在整个页面没有加载,但是错误从javascript返回阿贾克斯调用。

要查看它们,只需打开您的 javascript 错误控制台:),但是您不需要像 Raj 所说的表达式,您需要找到其他方式来显示您的错误。

当我进行一些测试并发现错误时,我出于这个原因删除了 Ajax 面板,找到错误,修复它们,然后放回 Ajax 面板

The expression it is thrown, but its handle by ajax, and now have be come Javascript errors, because now the full page is not loaded, but the error return back from javascript ajax call.

To see them just open your javascript error console :), how ever you do not need the expression as Raj say, you need to find other way to show your errors.

When I won to make some test and find my error, I remove the Ajax Panel for this reason, locate the error, fix them, then place back the Ajax Panel

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