开发者

Error not being displayed with updatepanel

开发者 https://www.devze.com 2023-01-05 15:57 出处:网络
It appears like something is stopping my errors from displaying normally an in ASP.NET site. Scenario 1 - I have an admin screen that has most of its content inside an updatepanel.When the user\'s se

It appears like something is stopping my errors from displaying normally an in ASP.NET site.

Scenario 1 - I have an admin screen that has most of its content inside an updatepanel. When the user's session times out. You click a button and nothing happens. It doesn't redirect you to the home page and it doesn't give you an error message.

Scenario 2 - I have some sort of data issue throwing an error - its happening on the staging environment otherwise I'd just debug the code normally. But instead of showing me the error you get the javascript type exclamation mark down the bottom and you need to quickly click on it to bring up a pop up dialog. In IE this happens. In FF there is no error message at all being shown.

My error in this instance is Sys.WebForms.PageRequestManagerServerErrorException: Sequence contains no elements. It then refers to a ScriptResource.axd... so based on this error message I'm having trouble working out what the problem is as I can't reproduce this on my dev environment. I believe its usually related to a linq statement referencing something with no elements but am not sure where the error is occurring or why. But am also wondering why this error appears to be being caught and not displayed lo开发者_JAVA技巧ok good old fashioned exceptions :)

So not sure if its an updatepanel issue or a scriptmanager related quirk. I imagine I'm using the wrong keywords to google as I can't find anyone else really complaining about the same thing :(

Thanks for any help!


For your first scenario, it seems as though you may need to check via a javascript ajax call whether the user's session is still active, and if not then redirect to the login page.

For the second scenario, I would suggest logging all exceptions on the server using a tool like ELMAH, which will give you a simple UI to view exception details.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号