There are a few more steps involved for this:
1. add runat="server" and id="someid" to your body-tag, like
<body id="someid" runat="server">
2. in the code behind class add a line of code to declare the control
protected HtmlGenericControl someid;
3. whereever in code you want to add the attribute code you can like this
someid.Attributes.Add("onUnload","alert('UnLoad worked!');");
>Hi, Cathi!
>
>>>
>You can execute javascript code to run when the page is posted back. Here is an example of having another window popup when the page is returned:
><<
>
>Ok, I got it - many thanks!
>
>BTW: Do you have any idea for dealing with the OnUnload attribute of the body tag in the same manner too?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi