Showing posts with label Article. Show all posts
Showing posts with label Article. Show all posts

Best Practices for Speeding Up Your Web Site

Today I found a greate article for  best practices for making web pages fast.The list includes 34 best practices divided into 7 categories.

 1) Content

    * Minimize HTTP Requests
    * Reduce DNS Lookups
    * Avoid Redirects
    * Make Ajax Cacheable
    * Post-load Components
    * Preload Components
    * Reduce the Number of DOM Elements
    * Split Components Across Domains
    * Minimize the Number of iframes

2) Server

    * Use a Content Delivery Network
    * Add an Expires or a Cache-Control Header
    * Gzip Components
    * Configure ETags
    * Flush the Buffer Early
    * Use GET for AJAX Requests

3) CSS

    * Put Stylesheets at the Top
    * Avoid CSS Expressions
    * Choose over @import
    * Avoid Filters

4) Javascript

    * Put Scripts at the Bottom
    * Make JavaScript and CSS External
    * Minify JavaScript and CSS
    * Remove Duplicate Scripts
    * Minimize DOM Access
    * Develop Smart Event Handlers

5) Cookie

    * Reduce Cookie Size
    * Use Cookie-free Domains for Components

6) Images

    * Optimize Images
    * Optimize CSS Sprites
    * Don’t Scale Images in HTML
    * Make favicon.ico Small and Cacheable

7) Mobile

    * Keep Components under 25K
    * Pack Components into a Multipart Document

For details check out this


Difference between "throw" and "throw ex" in .NET

Diffrence between throw and throw ex In this post i will show what is diffrence between throw and throw ex.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExceptionGotcha

    public class Foo
        /// <summary>
        /// Method that throw the exception.
        /// </summary>
        public static void MethodWithAttitude()
            throw new ApplicationException();
    class Program
        /// <summary>
        /// </summary>
        static void Method()
            catch (Exception ex)

                throw ex;

        static void Main(string[] args)

From the above code it is clear that exception is in the Foo class but if you execute this code then it will show exception in Program(Method) class.Where is the problem?.Let's modified the code little bit instead of throw ex put throw and instead of Exception ex put Exception and then execute the code it will show exception in Foo class. From above code it is clear that there is a diffrence between throw and throw ex
  1. throw ex resets the stack trace (so your errors would appear to originate from some other place)
  2. throw doesn't - the original stack trace would preserved.
  3. At MSIL level throw converted to rethrow

Adding a Context Menu to ASP.NET Controls

Although the context menu is a common element of most desktop applications, it is still fairly uncommon in Web application names because it doesn't map well to a server-based technology like ASP.NET. To get context menu functionality, your browser needs strong DHTML support and a rich eventing model, both of which you get in Microsoft® Internet Explorer 5.0 and newer versions, as well as in Netscape 6.0 and others. However, the various browsers' object models, although nearly identical in functionality, feature different members and names, and require you to map events and objects from one model to the other.
In this column, I'll create an ASP.NET context menu that addresses the Internet Explorer object model. Along the way, I'll call out features that can work with other browsers with some modifications. The code download for this column works with ASP.NET 1.x, but can be compiled under ASP.NET 2.0 Beta 1 as well. check out this link

Building a DAL using Strongly Typed TableAdapters and DataTables in VS 2005 and ASP.NET 2.0

he word Dataset does not need introduction because it is one of most commonly used object in .net world. So proceeding with this assumption, a typed dataset is an object that derives from Dataset class and additionally it provides strongly typed access to its containing tables and columns. To justify the above line still in depth, to access tables and columns in a dataset we use, check out this link for more details

ADO.NET Tutorial

DO.NET is a set of computer software components that can be used by programmers to access data and data services. It is a part of the base class library that is included with the Microsoft .NET Framework. It is commonly used by programmers to access and modify data stored in relational database systems, though it can also be used to access data in non-relational sources. ADO.NET is sometimes considered an evolution of ActiveX Data Objects (ADO) technology, but was changed so extensively that it can be conceived of as an entirely new product. check out this link for more details

Three Tier Architecture with ASP.NET

Brian Mains talks about the GridView control in the context of 3-tier ASP.NET applications. Three Tier Architecture with ASP.NET