Re: Dynamically setting a MasterPage's <body> tag style
- From: "Mark Rae" <mark@xxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Jul 2006 16:40:51 +0100
"John Timney (MVP)" <x_john@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:-OGdnVaY_MH7lSjZRVnyvg@xxxxxxxxxxxxxxxxx
To hazard a guess (I dont have a dev environment handy) could it be
because you have called your generic control and your body server control
the same names objBody, and your telling findcontrol to look for itself
Nope - I already thought of that and changed the variable name, but that
made no difference.
Incidentally, doing the whole thing in one long line doesn't generate the
error... e.g.
This generates the error, on the first line:
HtmlGenericControl HTMLBody =
(HtmlGenericControl)Master.FindControl("objBody");
HTMLBody .Attributes.Add("style", "background-image:
url(images/skylinelogo.gif);");
But this doesn't:
((HtmlGenericControl)Master.FindControl("objBody")).Attributes.Add("style",
"background-image: url(images/skylinelogo.gif);");
Both work perfectly...
This has really piqued my curiosity now! Can anyone shed any light on what's
happening here...?
.
- References:
- Dynamically setting a MasterPage's <body> tag style
- From: Mark Rae
- Re: Dynamically setting a MasterPage's <body> tag style
- From: Mark Rae
- Re: Dynamically setting a MasterPage's <body> tag style
- From: Göran Andersson
- Re: Dynamically setting a MasterPage's <body> tag style
- From: Mark Rae
- Re: Dynamically setting a MasterPage's <body> tag style
- From: John Timney \(MVP\)
- Re: Dynamically setting a MasterPage's <body> tag style
- From: JT
- Re: Dynamically setting a MasterPage's <body> tag style
- From: John Timney \(MVP\)
- Re: Dynamically setting a MasterPage's <body> tag style
- From: Mark Rae
- Re: Dynamically setting a MasterPage's <body> tag style
- From: John Timney \(MVP\)
- Dynamically setting a MasterPage's <body> tag style
- Prev by Date: Re: ASP Administratoin Console
- Next by Date: Re: Passing a value from server side to client side
- Previous by thread: Re: Dynamically setting a MasterPage's <body> tag style
- Next by thread: HttpHandler Problem in ASP .net 2.0
- Index(es):