Web Object objects NOT Appearing in aspx.cs

G

Guest

I need to add a method to the "onload" event of the <body> tag. The body tag
has been set to:

<body id="bodyComments" runat=server>

However, "bodyComments" is not recognizable in the web page's aspx.cs page.
(I have had similar problems with the <form> tag but found it eventually
appears if I close and relaunch VS.Net). I have relaunched VS this time but
no luck. What I am trying to do is shown in VS.Net help section on Javascript
so it "should" work?

I am using VS.Net 2003, version 1.1.4322 SP1. This problem existed before
applying SP1.

Thanks.
 
K

Kevin Spencer

Did you declare the Control in your CodeBehind class?

protected System.Web.UI.HtmlControls.HtmlGenericControl bodyComments;

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
G

Guest

Kevin,

Thank you that worked.

Are there any ASP.Net references that you could recommend? I'm new to
ASP.Net (but not C#), and I find my current resources lacking. Especially
when I use a MS example from their help (this <body> tag issue), and, correct
me if I am wrong, I see no mention on that help page of adding the
HTMLGenericControl to my aspx.cs page.

Thanks again for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
Martindap

Latest Threads

Top