Asp. Some suggestions on web standards in net development

Source: Internet
Author: User
Tags add header net client visual studio
Absrtact: NET development novice always encounters some asp.net in the development process and the Web standard conflict problem, here gives you several suggestions, lets the asp.net develop more conforms to the Web standard.

Visual Studio.NET from 2003 to now 2008, along the way to slowly strong ... From the previous vs2003 can automatically change your HTML code to now in the vs2008 can directly to the HTML code for the standard authentication and hint, very difficult.

The forum is also often engaged. NET development of the novice friend asked some ASP.net development process and web standards conflict between the problem, in fact, is the client code generation problem. More advanced development level of things I can not say, from the front of the page from the point of view and share the suggestions:

Less use of server-side controls in asp.net

In Visual Studio, there's a series of powerful controls that we're just beginning to learn. NET Developer Fondle admiringly. But these controls in VS are mostly based on the WinForm pattern, and some controls are better for web development, such as:

Do not have everything add form runat= "Server", a friend said, do not add a form runat= "server" other controls a lot of it can not be used. Yes, we just need to add in the necessary places, indeed there is a form of place, naturally to add, but definitely not. NET default, all pages are under the Body tab The first label is form. This is not reasonable.

Use less control such as Asp:gridview, consider Asp:repeater control or write yourself a Third-party control, it is very simple, let the code output listen to you.

Replacing the asp:label,asp:literal output with asp:literal is clean.

Less use Asp:linkbutton such controls, links are links, buttons are buttons, there is no need to engage in a LinkButton ...

The default form validation control is simple to use, but it is easier to write yourself.

In short, we have to focus on the quality of the output of the code, and some of the default controls are not up to this requirement.

Use less frameset/iframe labels

In general Web pages to use frames page layout (header/sidebar/content/footer) is basically eliminated, of course, the background management of this type of application is still available, the front-end display of the page can not be, Visual Studio 2005 began, There is a masterpage, this is very convenient to use. This is in fact similar to the early ASP include header.asp approach.

Less use of postback mechanism

. NET in the postback mechanism, has its reason, the reasonable use, the Internet product in the less use point is correct!

Look more mature. NET Open Source Products

For example: Microsoft Open Source Oxite, PetShop, Discuz forum. NET edition, BlogEngine, Cvbbs, etc., are all based on. NET development of a better example.

Pay more attention to client code quality

After all, browser-based, user experience, the standard of the Consortium, browser compatibility and so on, no good client code, are not supported.

Learn more about the necessary client knowledge

A lot. NET beginners don't know enough about html/css/javascript these client basics, especially JavaScript, and you'll find a lot of things you've been postback to the server before, The original JavaScript can be easily done on the client! Web development, this is the foundation!



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.