AutoPostBack combined with javascript's onBeforeUnload causes "Unspecified error"

J

Jonathan

Hi Everyone,
I have a problem which I've been able to reproduce with a nice and
small test ASP.NET web application. The page sets the
window.onbeforeunload event so that we will get an Ok/Cancel dialog box
to prompt users before navigating away from the page. There are many
different types of input buttons on the page (e.g. asp:Button,
asp:ImageButton, asp:LinkButton, asp:DropDownList, asp:CheckBox) and
most of them work fine. However, two of these controls don't work so
well: asp:DropDownList and asp:CheckBox (both controls have the
attribute AutoPostBack="True"). If the user clicks Cancel on the prompt
before the page unloads, an "unspecified error" is thrown in
javascript. Please could somebody point me in the right direction
towards fixing my code?
Many thanks,
Jonathan

P.S. I can provide the zipped source of the test project if anybody
thinks it might help them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top