Forum Moderators: open
The following code will put the attribute in the <FORM>, but it doesn't fire on the postback load.
Page.Form.Attributes.Add("onload", "OpenFile();")
There is no "Me.Attributes.Add" - that would be nice.
Another better option may be to use RegisterClientScript or RegisterStartupScript. If you are using .Net 2.0 then check out the ClientScript namespace.
[edited by: TheNige at 8:53 pm (utc) on Mar. 1, 2007]