T
tshad
In VS 2003, I am trying to set the onload property of the body tag to "". I
do this all the time from my Dreamweaver pages (one page aspx page). But in
a code-behind page I need to set a reference. How do I reference the <body>
tag?
I have the <body> set as:
<body id="myBody" onload="document.forms[0].Textbox3.focus()">
I change this as:
myBody.Attributes.Add("onLoad","");
I get the error:
The type or namespace name 'myBody' could not be found (are you missing
a using directive or an assembly reference?)
I realize that I need to add a reference and tried to do:
protected System.Web.UI.HtmlControls.Body myBody;
I get the error:
The type or namespace name 'Body' does not exist in the class or
namespace 'System.Web.UI.HtmlControls' (are you missing an assembly
reference?)
What would the reference be?
Thanks,
Tom
do this all the time from my Dreamweaver pages (one page aspx page). But in
a code-behind page I need to set a reference. How do I reference the <body>
tag?
I have the <body> set as:
<body id="myBody" onload="document.forms[0].Textbox3.focus()">
I change this as:
myBody.Attributes.Add("onLoad","");
I get the error:
The type or namespace name 'myBody' could not be found (are you missing
a using directive or an assembly reference?)
I realize that I need to add a reference and tried to do:
protected System.Web.UI.HtmlControls.Body myBody;
I get the error:
The type or namespace name 'Body' does not exist in the class or
namespace 'System.Web.UI.HtmlControls' (are you missing an assembly
reference?)
What would the reference be?
Thanks,
Tom