Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 default.aspx 页面,有时会导致 Global.asax 文件中捕获的异常。如何在不刷新页面的情况下将数据发送回我的 default.aspx 页面以更改 HTML 输出?那可能吗?
您将必须实现 try catch,然后检测错误并采取相应措施, 因此假设您知道在哪一行出现错误。
try { //error prone code } catch { reponse.write("error"); response.End() }
这样做你会捕捉到错误,它不会在 global.asax 文件中被捕捉到,并且"error"字符串将作为对用户的响应发回 *注意 - 这只是一个示例,代码的结构可能会因请求的类型GET或POST即使是AJAX基于请求的
"error"
GET
POST
AJAX