Asp.net 2.0 migrating series-master pages

Source: Internet
Author: User

Asp.net 2.0 migrating series-master pages
Fan weixiao

In Visual Web Developer 2005 Add one more Master pages, In Microsoft Vwd2005 Of Guided Tour It has a special introduction to its use. , It can be seen that it is ASP. net2.0 A major feature .
We are doing Html Page time , Sometimes this happens. : A website must have a uniform style , Therefore, the page styles are roughly the same. , Therefore, we all like to create Model Page , Then open it every time , Save it as an image Aboutus.html Such a page , Then Edit , Save it. Later, we started to use Frameset Separate pages, such as navigation menus, and use special Copyright Frame . Arrived ASP In the age, layout design and ASP CodeSeparated. After designing the layout, enter the code. For pages with similar styles, we also use Copy Style Html Code, and later to adapt Skin Technology, someone started Model Page, which needs to be inserted ASP Is similar $ Blogcontent $ And then useProgramThen analyze. Arrived ASP. NET Sometimes we try to use Usercontrol To achieve Frameset That way of thinking. Our " Soil method " Finally Vwd2005 It's over. This new Feature Compared Vwd2005 Designers are also designed to help you after suffering.
Here is Microsoft Migrating Pairs in the Series Master pages Introduction:
Master pages are a new feature introduced in ASP. NET 2.0 to help you reduce development time for Web applications by creating a single place to maintain a consistent look and feel in a site. master pages allow you to create a template that can be used to generate a common layout for different pages in the application. the primary goal of master pages is to avoid creating each page from scratch and having to repeat the layout code. another benefit of using master pages is that if you want to change the layout of the pages in the application, you only have to update the master page, rather than each individual page.
Master pages Yes ASP. Network 2.0 By creating a page to control consistent Styles, you can shorten development Web Application time. Master pages You can create a template to generate a page in the Program (if the style is consistent) with the same layout. Master pages The main purpose is to avoid the code that controls the page style from a page that has been built, and then repeat their page creation methods. Use Master pages Another benefit is that if you want to change the Page Style in the program, you only need to change this Master page You don't have to modify it one by one.
A master page looks like any ordinary ASP. NET web page extension t for the extension (. Master instead of. aspx) and some special controls and header fields. master pages must contain one or more<Asp: contentplaceholder>Controls. These controls represent areas of replaceable content. Basically, anything that is not inContentplaceholderWill appear on any page that uses the master page.
One Master page The page looks like other common ASP. NET Page, except for . Master To replace . Aspx And some special controls and title fields. Master pages Must contain one or more <Asp: contentplaceholder> Control. These controls represent the content to be replaced. Basically Contentplaceholder Will appear in use Master page .
Other than these key changes, a master page can contain any HTML or control that can be found on a normal ASP. NET page
In addition to these key changes, Master page The page can contain a common ASP. NET Any Html Code or control.
Here, Master pages Possible and Frame They are actually different, MS In this way, their differences are:
Although master pages and frames serve a similar purpose, master pages offer much more functionality. Unlike frames, using master pages allow you:
· Bookmark a page and recall all the information on the specific page, not just the default frame page. A master page isn' t really a frame. it's a single page that contains collated content from the master page and the content page that builds on the master. therefore it looks and acts like a single web page rather than a frame.
· Work in controls and tags rather than HTML. thanks to Visual Studio, you don't have to worry about opening and closing the frame tags or modifying countless HTML attributes to ensure that each frame displays in the fashion you want. you can simply create the place holder and modify its properties through Visual Studio.
· Leverage Visual Studio's code creation to exactly ally design the layout, manage the frames, and provide all of the plumbing to link the content pages into the master page. you can add new content without having to worry that the overall HTML layout of the page will be affected.

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.