473,657 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to put <style> in content page

ad
I use vs2005 to develop web application.
I have used the new feature of master page of VS2005, and I have put some
<stylein the master page.
But I want to override some Style sheet in the content page.
Where to put the <stylein the content page ?
Aug 4 '06 #1
2 2806
I don't think you can because the content place holder puts eveything within
div tags. Try a different aproach, try using css classes to define your
styles, you can then apply them to the relevent tags wherever you want, using
code.

"ad" wrote:
I use vs2005 to develop web application.
I have used the new feature of master page of VS2005, and I have put some
<stylein the master page.
But I want to override some Style sheet in the content page.
Where to put the <stylein the content page ?
Aug 4 '06 #2
Try one of the following in your page's Load event handler.

// Add a style sheet link.
HtmlGenericCont rol Style = new HtmlGenericCont rol();
Style.Attribute s.Add("type", "text/css");
Style.Attribute s.Add("rel", "stylesheet ");
Style.Attribute s.Add("href", "MyStyle.cs s");
Header.Controls .Add(Style);

// Add inline style.
HtmlGenericCont rol Style = new HtmlGenericCont rol();
Style.InnerText = "h1 { color: #0F0; } .MySelector { background-color:
#F90; }";
Header.Controls .Add(Style);
Good luck!

- Matt
----- Original Message -----
From: ad
Date: 8/4/2006 2:29 AM
I use vs2005 to develop web application.
I have used the new feature of master page of VS2005, and I have put some
<stylein the master page.
But I want to override some Style sheet in the content page.
Where to put the <stylein the content page ?

Aug 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
32669
by: Matthias Hullin | last post by:
Hi, I'm programming some PHP discussion board that is supposed to appear inside the content area of a proprietary CMS. As I need some more styles than the standard stylesheet provides, I just added a <style> tag inside my HTML code. It works fine in all the browsers I tested, but it seems to be more of a hack than a valid solution.
6
5457
by: Ken Varn | last post by:
I want to add my own custom <STYLE> section in the <HEAD> section of my ASP.NET page within a custom control. Can someone tell me how I can have my custom control add tags to the <HEAD> section of the page dynamically when the page is rendered? -- ----------------------------------- Ken Varn Senior Software Engineer Diebold Inc.
1
1736
by: Amil Hanish | last post by:
I want to dynamically create the <styletag. I know I can simply add a "runat" direction and set the inner value. But, I was curious if there was a more object-based way in .NET to do this. For example, can I create a collection of things like body, a, table, td, tr, etc and associate different style attributes to each one individually; then have .NET automatically render them for me (or even iterate over them myself). Thanks. Amil
2
5723
by: Sergey Poberezovskiy | last post by:
Hi, What is the "right" way to create a css rule similar to the following in a page header: &lt;style&gt; ..myRule{text-align:right;padding-right:10px;} &lt;/style&gt; I know that you can add simple styles as follows: this.Page.Header.StyleSheet.CreateStyleRule(style, this.Page, ".mySimpleRule");
1
1176
by: Sergey Poberezovskiy | last post by:
Hi, What is the "right" way to create the following css rule in a page header: &lt;style&gt; ..myRule{text-align:right;padding-right:10px;} &lt;/style&gt; I know that you can add simple styles as follows: this.Page.Header.StyleSheet.CreateStyleRule(style, this.Page, ".mySimpleRule");
5
3059
by: Jean Pierre Daviau | last post by:
Hi to every one. How can I manage to write this kind of css in a style="". img { width: 150 px; height: 100 px; text-align: center; }
5
1921
by: JackRbt | last post by:
I have a footer in a separate file that gets included via PHP, and that has its own styles. That means the footer's <style> is declared in the body, rather than as an element in <head>. Is there any problem with doing it that way? My aim is simply to include "footer.php" and have it all turn out okay, without messing with anywhere else. The HTML that is output by PHP is below:
1
2026
by: Lagon666 | last post by:
How can i get css contains of an element. When i use alert(document.getElementById('mydiv').style.opacity) it will return empty. <style> #mydiv{ background:#000000; opacity:0.4; } </style>
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.