Top ten essential tools for building ASP. NET websites

Source: Internet
Author: User
Recently I used ASP. NET to build a simple public website for my company (the address of this Website: http://superexpert.com /). In this process, we use a large number of free tools. It will be very interesting to summarize the necessary tools for building an ASP. NET Website. These tools support both ASP. NET web forms and ASP. net mvc.

Performance Tools

Read
Two books on the front-end performance of the website (these two excellent books are: high performance web sites and even faster
Web sites, by Steve Souders), I am very sensitive to the front-end performance of the website. According to Steve Souders's prime performance rule:

"First, we should optimize the front-end performance. The end user's response time is 80% or more ." You can use the following tools to reduce the size of images used by ASP. NET applications, as well as the size of JavaScript files and CSS files.

1, Sprite and image Optimization Framework

In an article in a list apart (this article titled: CSS Sprites: Image slicing's kiss of death, For details, refer to: http://www.alistapart.com/articles/sprites), the first mention of CSS Sprites. When using sprites, You need to combine multiple images used by a website into a single image. Then, on a web page, use CSS trickery to display a specific "sub-image ".

Sprites can effectively reduce the number of requests when displaying a Web page. Requesting a large image is much faster than requesting multiple small images. Generally, the more resources (images, JavaScript files, and CSS files) transmitted over a network cable, the slower your website will be.

However
Yes, most people do not want to use sprites, because using sprites requires a lot of work. You must merge all the images and then write appropriate CSS rules to display the sub-
Image. Microsoft's Sprite and image Optimization Framework
This frees us from the tedious work. This frame can automatically merge images for you. In addition, this framework also contains an ASP. NET web forms Control
And an ASP. net mvc helper, which makes it easier to display sub-images. You can download Sprite and image from codeplex
Optimization Framework.

: Http://aspnet.codeplex.com/releases/view/50869

Sprite
And image Optimization Framework is Morgan McClean
. At Microsoft, his office is close to my office. Morgan is a very smart person. He is a Canadian intern. When he built the framework, we discussed the box.
Rack. (As far as I know, he is still developing this framework .)

Morgan adds some advanced features to this framework. For example, Sprite and Image
The Optimization Framework supports "image inlining ". When you use "image ",
Inlining ", the real image is stored in the CSS file. This is an example of "image inlining:

 
  1. .Home_StephenWalther_small-jpg  
  2. {  
  3.  
  4. width:75px;  
  5. height:100px;  
  6. background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABkCAIAAABB1lpeAAAAB  
  7. GdBTUEAALGOfPtRkwAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKL  
  8. s+zNfREAAAAASUVORK5CYII=) no-repeat 0% 0%;  
  9.  
  10. } 

True
A positive image (in this example, an image displayed on the superexpert.com website homepage) is stored in this CSS file. If you browse
On the superexpert.com website, you will find that few independent images can be downloaded. In the following figure, all images with red boxes use CSS.
Sprites:

No
Fortunately, using the sprite and image Optimization Framework
When there are some "traps", please note. In order to bypass these "traps", there are still some peripheral work to be done. In my subsequent articles, I will detail what these "traps" are and how
Bypass these "traps ".

2. Microsoft Ajax minifier

At any time, you should use "far future Header" to merge, minimize (Minify), compress and cache all JavaScript and CSS files. Microsoft Ajax minifier makes it easier to minimize JavaScript and CSS files.

Please do not confuse the minimization and compression. You need to do both of these jobs. According to Souders, after you compress a Javascript file, you can minimize the size of the file by 20% (average.

When
When you minimize a Javascript file or a CSS file, you can use various techniques to minimize the size of the file before compressing it. For example, you
You can use a short JavaScript variable name to replace a long JavaScript variable name, and remove unnecessary blank spaces and annotations to minimize
JavaScript. You can minimize CSS files in the same way. For example, you can replace the long color name (# fffff) with the short color name (# fffff ).

Microsoft
Ajax minifier is Microsoft employee Ron Logan
Developed. This tool is used internally by several large Microsoft websites. We also use this tool in the ASP. NET team. I think Ron can publish this tool to codeplex.
So that everyone in the world can use this excellent tool. You can download this tool from the ASP. NET Ajax site:

: Http://www.asp.net/ajaxlibrary/Download.ashx

This tool documentation can refer to: http://www.asp.net/ajaxlibrary/AjaxMinDocumentation.ashx

Me
Creates an installer for Microsoft Ajax minifier. When creating the installer, I also created a visual
Maxcompute studio generates a task.
When studio is automatically generated, it makes it easier to minimize JavaScript and CSS files. You can use
Quick start to learn how to prepare this generation task. (For details about Ajax minifier Quick Start, refer to: http://www.asp.net/ajaxlibrary/AjaxMinQuickStart.ashx)

3, yslow

Yslow is a free Firefox extension provided by Yahoo. It allows you to test the front-end of your website.

Http://developer.yahoo.com/yslow/ of yslow

This is the current test result of the "superexpert.com" Website:

"Superexpert.com"
The overall score of the website is "B" (not perfect, but not bad ). Yslow is not perfect. For example, although
The superexpert.com website uses Microsoft Ajax content that supports JavaScript libraries (such as jquery ).
Delivery network (for Microsoft Ajax content delivery network, refer to: http://www.asp.net/ajaxlibrary/cdn.ashx), but still get "F" because the content delivery network is not used ".

(This article is reproduced from 51cto and translated by Zhou Xuefeng. )

Normal running time

After a website is published, you certainly hope that your website will not encounter any problems and will remain in normal operation. Now, I use the following tools to monitor the "superexpert.com" website and make sure it remains in normal operation.

4, elmah

Elmah is short for error logging modules and handlers for ASP. NET. Elmah allows you to record any errors on your website. In the future, you can re-check these errors. You can download elmah from the elmah official website for free at http://code.google.com/p/elmah /.

Elmah
Supports both ASP. NET web forms and ASP. NET
MVC. You can configure elmah to store various errors (XML files, Event Logs, access databases, SQL databases, Oracle databases, or computers ).
Ram .) You can also ask elmah to email you the error message when an error occurs.

By default, in a website with elmah installed, you can access elmah by requesting the elmah. axd page. This is the appearance of the elmah page of the "superexpert.com" website (this page is password-protected because some confidential information may be leaked in an error message .)

If you click an error message, you can see the original ASP. NET yellow screen error message (although this error message will never be displayed to real users ).

I used the brand new ASP. NET Package Manager nuget (formerly called nupack) to install elmah. For details about nuget, refer to Scott Guthrie's blog: Workshop. You can download nuget from codeplex: http://nuget.codeplex.com /.

5, pingdom

I use pingdom to verify that the superexpert.com website is always running. You can register pingdom by browsing "pingdom.com. You can use pingdom to monitor a website for free.

On the pingdom website, you can configure the frequency for pingdom to ping your website. I verify that the superexpert.com website is always running every five minutes. I use the pingdom service to verify whether it can retrieve the string "Contact Us" from the home page of the website ".

If your website goes down, you can configure pingdom to send an alert via email, Twitter, SMS, or iPhone. I am using this pingdom iPhone application:

6. Host Tracker

If your website goes down, you need some methods to determine whether this is a problem with the local network or whether your website goes down for everyone. I use a website called Host-Tracker.com to check the extent to which a website is down.

This is the result of host-tracker when the "superexpert.com" website can be pinged from all over the world:

Note: Host-tracker can ping the "superexpert.com" website from 68 locations (including Roubaix, France, Scranton, and PA.

Debugging

The "Debugging" I mentioned here has a wide range of meanings. When building a website, I use the following tools to verify that I have not made any mistakes.

7. html spell checker

Why does Visual Studio not have a built-in spelling checker? I don't know-I think this is incredible. However, fortunately, a free spelling checker is written by a former member of the ASP. NET team. You can use this spell checker on the ASP. NET page.

I found that a spelling checker is essential. Think that your spelling ability is perfect, just deceiving yourself. When I really run the spelling check tool and find all my spelling mistakes, I can't wait to find a place to crack.

Set html
The fastest way to add the spell checker extension to Visual Studio is in visual
In studio, select the "Tools" menu item and click "Extension Manager ". Click "online"
Gallery, and then search for "HTML spell checker ":

8. IIS Seo Toolkit

For example
If people cannot find your website through Google, it is better not to build this website. Microsoft provides an excellent IIS extension called "IIS search engine"
Optimization Toolkit (for details about IIS Search Engine Optimization toolkit, refer to: http://www.iis.net/download/seotoolkit), you can use it to detect problems that may affect page ranking. You can also use it to quickly create a sitemap for your website. You can submit This sitemap to Google or Bing. You can even generate a sitemap for an ASP. net mvc website.

This is an overview of the analysis report on the "superexpert.com" Website:

Note: The "sueprexpert.com" website has many problems. For example, the hyperlinks on 65 pages have expired. You can further view the details of these problems and find out the location and specific page of these problems.

9, linqpad

For example
If your ASP. NET Website needs to access a database, you should use
Entity Framework. Using LINQ, some magical queries written in C # are converted into SQL queries. If you are not careful when writing a LINQ query
It is very likely that a website with poor performance will be built unintentionally.

Linqpad (linqpad's official site: http://www.linqpad.net/) is a free tool that lets you experiment with your LINQ queries. It even supports Microsoft SQL Ce 4 and azure.

You can use linqpad to execute a LINQ to entities query and check the result. You can also use it to view the SQL statements executed on that database:

10,. Net Reflector

Me
Use. Net reflector every day .. Net
The reflector tool allows you to decompile an assembly into C # Or VB. NET code. When you do not have real source code, you can use. net
Reflector to view the "source code" of an assembly ". You can download the free version of. Net reflector from the Redgate Website: http://www.red-gate.com/products/reflector /.

Me
I mainly use. Net reflector to help me figure out how the code works internally. For example, to better understand MVC Image
How does helper work, I use. Net reflector on the sprite and image Optimization
Framework. This is part of the disassembly code of the image helper class:

Summary

In
In this blog, we discussed several tools I used to build the "superexpert.com" website. I use these tools to improve
The performance of the "superexpert.com" website improves the SEO (search engine) of the "superexpert.com" website
Optimization) to ensure the normal running time of the "superexpert.com" website, or debug the "superexpert.com" website. Here
All the tools discussed in this blog are free of charge. In addition, all these tools support both ASP. NET web forms and ASP. net mvc.

 

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.