CSS planning suggestions for ASP. NET application development

Source: Internet
Author: User

Do not define too much or define only one CSS file. According to the suggestions provided by my colleagues in the Web standard, the CSS of the Web application can be planned into four files:
(1) base.css
(2) from.css
(3) frame.css
(4) list.css
I don't want to introduce the significance of the above style file. (If the portal is not suitable for such planning)

To better apply these four CSS files. there are many other reasons, of course, when we set the code. it is best to set the base class of some pages. the following are four basic page classes that I usually use.
(1) pagebase. CS
(2) pagefrombase. CS
(3) pageframebase. CS
(4) pagelistbase. CS
The source code of pagebase. CS and pagelistbase. CS is provided here.

Public class pagebase: system. Web. UI. Page
...{
Protected override void oninit (eventargs E)
...{
Htmllink link = new htmllink ();
Link. Attributes. Add ("type", "text/CSS ");
Link. Attributes. Add ("rel", "stylesheet ");
Link. Attributes. Add ("href ","~ /App_common/styles/base.css ");
This. header. Controls. addat (1, link );

Base. oninit (E );
}

Public String key
...{
Get
...{
Return request. querystring ["key"];
}
}
} Public class pagelistbase: system. Web. UI. Page
...{
Htmllink link = new htmllink ();
Link. Attributes. Add ("type", "text/CSS ");
Link. Attributes. Add ("rel", "stylesheet ");
Link. Attributes. Add ("href ","~ /App_common/styles/list.css ");
This. header. Controls. addat (2, link );

Base. oninit (E );
}

Private int _ pageindex = 0;
Public int pageindex
...{
Get
...{
Return _ pageindex;
}
Set
...{
_ Pageindex = value;
}
}

Private int _ pagesize = 16;
Public int pagesize
...{
Get
...{
Return _ pagesize;
}
Set
...{
_ Pagesize = value;
}
}

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.