Groups | Blog | Home
all groups > asp.net > march 2005 >

asp.net : Body Classname from Codebehind page


Karl Seguin
3/16/2005 5:47:19 PM
RJ:
Stick on ID on the body with a runat=3D"server" declare it as an =
HtmlControls.HtmlGenericControl

and then you can do

control.Attributes.Add("Class", "YourClass")


Karl

--=20
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is =
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to =
come!)


[quoted text, click to view]
Hi,
I want to switch some info in the Codebehind page.
Everything is working but one thing.
I need to set the classname of the body at the page load.
I cannot find on how to do this from the code behind page.

Normaly i take the protectec System.Web.UI.HtmlControls. ..... =
Controls or other controls and this works fine.
But now one more step on doing this on the body tag and i am very much =
helped.

Regards,
RJDev
3/16/2005 11:25:16 PM
Hi,
I want to switch some info in the Codebehind page.
Everything is working but one thing.
I need to set the classname of the body at the page load.
I cannot find on how to do this from the code behind page.

Normaly i take the protectec System.Web.UI.HtmlControls. ..... Controls =
or other controls and this works fine.
But now one more step on doing this on the body tag and i am very much =
helped.

Regards,
RJDev
3/17/2005 7:45:30 PM
Thnx Karl for your support,
This works fine.

Stupid of me not to think of it this way.

Thnx again
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME =
net> schreef in bericht news:e%23c1OonKFHA.3616@TK2MSFTNGP09.phx.gbl...
RJ:
Stick on ID on the body with a runat=3D"server" declare it as an =
HtmlControls.HtmlGenericControl

and then you can do

control.Attributes.Add("Class", "YourClass")


Karl

--=20
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is =
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to =
come!)


[quoted text, click to view]
Hi,
I want to switch some info in the Codebehind page.
Everything is working but one thing.
I need to set the classname of the body at the page load.
I cannot find on how to do this from the code behind page.

Normaly i take the protectec System.Web.UI.HtmlControls. ..... =
Controls or other controls and this works fine.
But now one more step on doing this on the body tag and i am very =
much helped.

Regards,
AddThis Social Bookmark Button