Have you tried Page.FindControl("MyBody")? Or, Master.FindControl (whichever
the case may require)?
Peter
"tshad" <> wrote in message
news:...
>I have the body tag of my page in my master page.
>
> <body id="MyBody" runat="server">
>
> In my control that is on the page, I want to set the onload event which I
> would do if it was in my control but it isn't:
>
> MyBody.Attributes.Add("onclick", "TestIt();");
>
> Is there a way to do this from the control?
>
> Doing this gives me the error:
>
> Error 5 The name 'MyBody' does not exist in the current context
>
> Thanks,
>
> Tom
>
>
|