Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Body from Code Behind
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01145622
Message ID:
01145694
Vues:
18
>Does anyone know how to access the HTML BODY from the code behind? I want to change the CSS class of the BODY in my page load event.

Sure you can make any tag on a page a server control by adding a runat="server" to the tag.

Just use:
<body runat="server" id="tagBody">
then in codebehind:
this.tagBody.Attributes.Add("class","mycssclass");
+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform