473,569 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.Net 2.0 - how to add custom style into page headerin code

Hi,

What is the "right" way to create the following css rule in a page header:
<style&gt ;
..myRule{text-align:right;pad ding-right:10px;}
</style>

I know that you can add simple styles as follows:
this.Page.Heade r.StyleSheet.Cr eateStyleRule(s tyle, this.Page,
".mySimpleRule" );
but then I am not sure how to set text-align, padding or similar styles to a
System.Web.UI.W ebControls.Styl e object

I am trying to avoid putting literal into my header and altering its content.

Any help is appreciated.
May 1 '07 #1
1 1163
On May 1, 4:23 am, Sergey Poberezovskiy wrote:
Hi,

What is the "right" way to create the following css rule in a page header:
<style&gt ;
.myRule{text-align:right;pad ding-right:10px;}
</style>

I know that you can add simple styles as follows:
this.Page.Heade r.StyleSheet.Cr eateStyleRule(s tyle, this.Page,
".mySimpleRule" );
but then I am not sure how to set text-align, padding or similar styles to a
System.Web.UI.W ebControls.Styl e object

I am trying to avoid putting literal into my header and altering its content.

Any help is appreciated.
http://groups.google.com/group/micro...200e6aec7f6062

May 1 '07 #2

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

Similar topics

1
4060
by: Michael ALbanese | last post by:
I am developing a telephone directory for my company. I have Fist Name, Last Name, Department and Phone Number as fields. A user can search by entering data into any one, or combination of these fields. I have been trying to write a custom validation control that will test each of the textboxes and reject the request if they are ALL...
3
6893
by: Simon Wigzell | last post by:
I have an image with several links in it in mapped areas. I am using a custom cursor on the page and would like to have a custom cursor appear on mouse over of the mapped links. Something like: This works for the body, font or img tag: <body style="cursor: url('cursor2.cur')"> <font style="cursor: url('cursor1.cur')">Text</font> <img...
3
10822
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1 which has to parameters passed to it from another Web page Parameter # 1 dbid and Parameter # 2 reportid. I know that I can access the values of...
0
1899
by: adam | last post by:
i have custom user control and i'm trying to pass values to custom user control......I need help it seems to me i cannot pass the value to user control from dropdownlist. I have property in a control. In a default.aspx page <SkinExample:Hello id="HelloControl" SkinName="red" runat="server" /> i can pass the value, it works fine, but from the...
19
2961
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page...
3
1381
by: Lloyd Sheen | last post by:
I have a piece of functionallity that is replicated on several pages. This would be a good candidate for a custom control right? Well I found a couple of tutorials (none really helpful) so I created a simple asp app and added a custom control to the project. Now to the problem. I created the control using a GridFlow control so that the...
2
2501
by: Alani | last post by:
Hello All, I'm a new ASP.NET programmer and I want to create a custom control consist of two properties (Number1) and (Number2) and both of them are integers and default value = 0, now I'm using callback technique so I can change those two proprties via ChangeNumber1 and ChangeNumber2 functions. what happens is that when I change the...
2
5703
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
3060
by: SachinSachin | last post by:
Hi All, I am implementing a custom gridview control, that emits some javascript to blink a row whenever a new row is added in gridview. The gridview is inside the <asp:updatepanel> for parital page rendering. The problem is when I put the gridview inside the updatepanel, I don't see the HTML table that is created as a result from rendering...
0
8119
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...
1
7668
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...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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...
1
5509
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.