asp.net - Why are exceptions in partial postback (UpdatePanel) not logged to eventlog -
in standard postback, if exception occurs, error logged event log under source "asp.net 4.0.30319.0". lots of details here.
if exception occurs during partial postback function via updatepanel call, why exception not logged event log, , there need enable cause functionality work?
i can verify in both cases onerror function of page fire, in postback error logged.
i don't know why exceptions aren't logged event log
here not-so-nice work-arounds i've found far:
rethrow in asyncpostbackerror
catch exception in scriptmanager
's asyncpostbackerror
event. wrap , throw it.
disadvantages
- the client javascript code loses original exception message.
- the exception wrapped unnecessarily, may make debugging tiny bit more tedious.
disable enablepartialrendering
disable enablepartialrendering
on scriptmanager
.
advantages
- errors handled in manner consistent non-async postbacks.
disadvantages
- seems kind of defeat purpose of using
updatepanel
s. - you lose access client-side classes such
sys.webforms
.
Comments
Post a Comment