Some Suggestions on Web standards in ASP. NET development

Source: Internet
Author: User

Visual Studio. NET from 2003 to the current 2008, along the way slowly powerful ...... Since vs2003 was able to automatically mess up your html code, and now in vs2008, html code can be directly verified and prompted by w3c standards, which is very difficult.

In the forum, new users who are engaged in. NET development often ask questions about conflicts with Web standards during ASP. NET development. In fact, the client code is generated. I can't tell you more about development. I would like to share my suggestions with you from the perspective of the front-end of the page:

Use fewer server-side controls in ASP. NET

In Visual Studio, there are a series of powerful controls that make it easy for our start-up. NET developers. However, most of the controls in vs are migrated based on the winForm mode. In web development, it is better to use fewer controls, such:

Do not always add form runat = "server". Some friends say that many other controls cannot be used without form runat = "server. Yes, we just need to add it where necessary. There is indeed a form. Naturally, we need to add it, but it is definitely not. NET by default, all pages are under the body tag. The first tag is form. This is unreasonable.

If you do not use controls such as Asp: Gridview, consider the asp: Repeater control or write a third-party control by yourself. It is very simple to let the code output listen to your control.

Asp: Label is replaced with asp: Literal, and asp: Literal output is clean.

Use less controls such as asp: LinkButton. links are links and buttons are buttons. There is no need to create a LinkButton ......

Although the default form verification control is easy to use, it is easy to write by yourself.

In short, we should pay attention to the quality of code output, and some default controls do not meet this requirement.

Use less Frameset/Iframe labels

In general, the use of frame pages for layout (Header/Sidebar/Content/Footer) on webpages has basically been eliminated. Of course, applications such as background management can still be used, the page displayed on the front end cannot be used. MastERPage is available at the beginning of Visual Studio 2005, which is also very convenient to use. In fact, it is similar to include header. asp in early asp.

Use less PostBack Mechanism

The postback mechanism in. NET has a reason to use it properly. It's right to use less Internet products!

More mature. NET open-source products

For example, Microsoft's open-source oXite, PetShop, Discuz Forum. NET, BlogEngine, and CVBBS are all good examples developed based on. NET.

Focus more on client code Quality

After all, it is browser-based, user experience, W3C standards, browser compatibility, and so on. Without good client code, it is not supported.

Learn more about the necessary client

Many. NET beginners do not know enough about the basic knowledge of html, css, and JavaScript clients, especially Javascript. You will find that many of the things you have done before are Postback to the server, it was easy to use javascript on the client! Web development is the foundation!

  1. Implementation of ASP. NET report printing: Paging Calculation Method
  2. ASP. NET DataGrid custom paging source code
  3. Implementation of ASP. NET paging code (C #, FCKeditor)
  4. Overview of ASP. NET basic syntax
  5. ASP. NET Installation Steps

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.