Groups > Asp .Net > Getting started with ASP.NET > Re: css applied across all aspx pages in a web app?




css applied across all aspx pages in a web app?

css applied across all aspx pages in a web app?
Thu, 3 Apr 2008 22:00:56 +0000
I want to use the same css stylesheet in all my aspx pages, is it possible to
link all my pages to one sheet, like somehwere in my webconfig or something?
Currently I am inserting this line in each of my aspx pages: <style
type="text/css" media="screen">@import url(../Styles.css
);</style>

 Also at the top of all my .cs pages I'm using a ton of these using statements
(kept list short for this post):


using System;
using System.Data;
.....

using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls; 

 

Is there some way to apply them across all my .cs pages? In my global.asax or
webconfig? Thanks.
Post Reply
Re: css applied across all aspx pages in a web app?
Thu, 3 Apr 2008 22:37:44 +0000
why not use master pages ?
Post Reply
Re: css applied across all aspx pages in a web app?
Thu, 3 Apr 2008 22:45:49 +0000
Can you apply the "using" statements across pages created from a
master page?

 And is it easy to implement master pages even though I've already created all
my pages.
Post Reply
Re: css applied across all aspx pages in a web app?
Thu, 3 Apr 2008 22:50:29 +0000
Yes master pages are easy.

And you dont need any using statement.

Just create your masterpage

and have your pages inherited from that master pages and thats it.

see:

http://msdn2.microsoft.com/en-us/library/wtxbf3hh.aspx

http://www.odetocode.com/Articles/419.aspx
Post Reply
Re: css applied across all aspx pages in a web app?
Thu, 3 Apr 2008 22:53:18 +0000
masterpage
Post Reply
about | contact