By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,910 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,910 IT Pros & Developers. It's quick & easy.

<div runat="server"> tags not working

P: n/a
I have one page where i have some <div> tags set to be runat="server" (and
i've given them an id) and i can access them from the code-behind file just
fine.
I have another page where i've done essentially the same thing (even copying
the code from the other file) and i cannot access them from the code-behind
file.

Any clues what would cause this?

Just a tad frustrating because i can't move forward on this page without
accessing those...

Thanks in advance,

Tim
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
so you have them declared in the codebehind?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...
I have one page where i have some <div> tags set to be runat="server" (and
i've given them an id) and i can access them from the code-behind file just fine.
I have another page where i've done essentially the same thing (even copying the code from the other file) and i cannot access them from the code-behind file.

Any clues what would cause this?

Just a tad frustrating because i can't move forward on this page without
accessing those...

Thanks in advance,

Tim

Nov 18 '05 #2

P: n/a
Nice catch. No, i didn't have them declared in the code-behind.
Of course, i didn't declare them myself in the code-behind on the page that
worked. VS.NET must have done it on the first one and not on the second one
for some reason.
Interesting.
Thanks!

Tim

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
so you have them declared in the codebehind?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Tim Mulholland" <Ti***********@nospamaddress.com> wrote in message
news:eN**************@TK2MSFTNGP10.phx.gbl...
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file

just
fine.
I have another page where i've done essentially the same thing (even

copying
the code from the other file) and i cannot access them from the

code-behind
file.

Any clues what would cause this?

Just a tad frustrating because i can't move forward on this page without
accessing those...

Thanks in advance,

Tim


Nov 18 '05 #3

P: n/a
Did you check the contents of the windows designer
generated code from the source code-behind file? It may be
hiding a reference to the object, such as..

Protected WithEvents myControl as
system.web.webcontrols.label

You always need a reference in the code-behind to access
the web form controls.

Might help!

-----Original Message-----
I have one page where i have some <div> tags set to be runat="server" (andi've given them an id) and i can access them from the code-behind file justfine.
I have another page where i've done essentially the same thing (even copyingthe code from the other file) and i cannot access them from the code-behindfile.

Any clues what would cause this?

Just a tad frustrating because i can't move forward on this page withoutaccessing those...

Thanks in advance,

Tim
.

Nov 18 '05 #4

P: n/a
Yeah, i found that i was missing the reference in the code-behind. I hadn't
added it in myself in the first page, so i dind't remember that it had to be
there in the non-working page.
Thanks (and nice name...)

Tim

"Michael Mulholland" <an*******@discussions.microsoft.com> wrote in message
news:76****************************@phx.gbl...
Did you check the contents of the windows designer
generated code from the source code-behind file? It may be
hiding a reference to the object, such as..

Protected WithEvents myControl as
system.web.webcontrols.label

You always need a reference in the code-behind to access
the web form controls.

Might help!

-----Original Message-----
I have one page where i have some <div> tags set to be

runat="server" (and
i've given them an id) and i can access them from the

code-behind file just
fine.
I have another page where i've done essentially the same

thing (even copying
the code from the other file) and i cannot access them

from the code-behind
file.

Any clues what would cause this?

Just a tad frustrating because i can't move forward on

this page without
accessing those...

Thanks in advance,

Tim
.

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.