style sheets

  • Thread starter Thread starter No One
  • Start date Start date
N

No One

I have a style sheet file that I would like all .aspx pages to use by
default. Is there a way to set this globally? If so, how?

Thanks.
 
The two ways people would mention the most would be to use either a common
base page in all your pages, or to use master pages.

My personal opinion is that for this type of presentation layer stuff, go
with master pages (which you'll find useful a bunch of other ways as well)

http://www.metabuilders.com/Tools/MasterPages.aspx

Karl
 
Hi karl,
I just drop by, and have a question about it. I don't know how to use
masterpages in VS .Net 2003 to development my page, as it seems not
supporting.. I had tried b4 but fail to use it, is there anything to
install or it is only available to new version VS.??

Thx.
Rena.
 
I am not sure I understand the common base option. If I create a webform with
C# code behind and set the still sheet in the HTML, how is this enherited to a
new form?
 
You create a class:

class MyBasePage : System.Web.UI.Page{

public override Render(HtmlTextWriter writer){
writer.Write("<link....");
base.Render(writer)
}

}

and you make your webforms inherit from that instead of directly from Page

Class WebForm1 : MyBasePage{
//everything else the same
}


the code for the base class isn't 100%...I don't have VS open so
HtmlTextWriter might be wrong and how to use it might be wrong..but should
give you enough to go by ...

Karl
 

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

Back
Top