Building ASP.NET application - Best Practices

Viewed 8684

We are building an ASP.NET application and would like to follow the best practices. Some of the best practices are:


Server side Code:

  • Use catch blocks to trap & log low level errors too.
  • Use Cache objects to populate dropdowns etc. where we won’t expect the changes in the underlying data/database.
  • In case of error logging framework, provide emailing alerts along with logging the errors.

HTML code: - Don’t write inline CSS. - Place the JavaScript code (If needed by the page) at the end of the page unless the page needs it for load time actions.


Now coming to the point, Would you please share these best practice points if you have a comprehensive list of them already?

7 Answers

ASP.NET

  • If you don't use Session state, don't forget to turn off it.
  • Use Server.Transfer instead of Response.Redirect if possible.
  • Set expiration parameter in IIS.
  • Use GZip to compress the text files.
  • Use Server-Side and Client-Side validation together.
  • Use Url Rewriter or Routing to make friendly url for SEO.

Design

  • Write each class and its properties of your CSS file in the same line. (To decrease the file size)
  • Use CSS Sprites. (To decrease request)
Related