As the body tag isn't inside the form tag, it won't be declared
automatically in the code behind, you have to declare it yourself:
<body id="Body" runat="server">
protected HtmlGeneericControl Body;
Body.Attributes.Add("onbeforeunload", "alert('Good riddance.');");
Note:
The onbeforeunload event is not a part of the standard, it will only
work in Internet Explorer, and perhaps not even there if the page is in
standards mode.
> Hi,
>
[quoted text clipped - 6 lines]
> Thanks,
> WB
WB - 13 Jul 2006 22:11 GMT
Thanks, Göran!
> As the body tag isn't inside the form tag, it won't be declared
> automatically in the code behind, you have to declare it yourself:
[quoted text clipped - 20 lines]
> > Thanks,
> > WB