Body Classname from Codebehind page

R

RJDev

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,
RJ
 
K

Karl Seguin

RJ:
Stick on ID on the body with a runat="server" declare it as an HtmlControls.HtmlGenericControl

and then you can do

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


Karl

--
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!)


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,
RJ
 
R

RJDev

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 RJ:
Stick on ID on the body with a runat="server" declare it as an HtmlControls.HtmlGenericControl

and then you can do

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


Karl

--
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!)


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,
RJ
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top