November 22, 2006

PreCompilation in ASP.Net 2.0

What is PreCompilation?
     Before looking into that, let us see, what happens in a web app when the first request arrives. When the first request for a website arrives, the worker process is started first, then the CLR initializes, all the aspx pages are parsed and compiled into intermediate language, methods are just in time compiled to native code. Due to these prcesses running , we face a performance problem, but this will not exist for the subsequent hits. In order to avoid this drawback, the all new ASP.Net 2.0 comes with a concept of PreCompilation.

     And now, what is precompilation? Using PreCompilation, we compile the website before hand and deploy it in the server, so as the first request arrives there will be not be any delay. Hence it drastically improves the performance of the website.

     There are two types of precompilation, In place Precompilation and Precompilation for deployment.

     In place precompilation eradicates the initial delay we face when your website is hit first time, while the Precompilation for deployment creates the executable version of your website, which you can deploy using FTP or XCopy.

     The aspnet_compiler.exe is the utility to precompile the web apps. To know all the available options for precompilation type aspnet_compiler /? in the .net command prompt.

November 21, 2006

Session State Management in ASP.Net

ASP.NET provides three ways of maintaining client-specific state: session state, cookie state, and view state. Each technique has its own advantages and disadvantages.
Session state is the most flexible and, in general, the most efficient. ASP.NET has enhanced session state to address some of the problems associated with it in previous versions of ASP, including the abilities to host session state out of process or in a database(SQL Server) and to track session state without using cookies.
Session state is maintained on behalf of each client within an ASP.NET application. When a new client begins to interact with the application, a new session ID (or session key) is generated and associated with all subsequent requests from that same client . By default, the session state is maintained in the same process and AppDomain as your application, so you can store any data type necessary in session state.
To know more about the Session State management, there is an excellent article posted in ASPAlliance, and the link to this is here.
For experts, the best practices to be followed in Session state management is here.

November 17, 2006

Alternate way to view source

This is really good Tip. What do we do when we want to view source of a web page? we right click the page and select view source, which will open the source in the source editor you have configured.

Just type the below mentioned line in the address bar of the IE.

javascript:'<xmp>'+window.document.body.outerHTML+'</xmp>';

This will list the source of the page in the same window of the web page.

November 11, 2006

ASP.Net AJAX Beta 2 released

ASP.Net AJAX Beta 2 is released... By the way what is this? This is a free framework for quickly creating a new generation of more efficient, more interactive and highly-personalized Web experiences that work across all the most popular browsers, which was earlier code named as 'ATLAS'.

With ASP.NET AJAX, developers can quickly create pages with rich, responsive UI and more efficient client-server communication by simply adding a few server controls to their pages. This new Web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 development framework. ASP.NET AJAX provides developers building client-based Web experiences with a familiar development process and programming model that they already know from using server-side ASP.NET development. Because ASP.NET AJAX is integrated with ASP.NET, developers have full access to the built-in ASP.NET 2.0 application services and the entire .NET Framework.

To learn more visit the official ASP.NET AJAX Site.

November 10, 2006

Coding guidelines

While reading Brad Abrams archives, i read this excellent article on writing a readable and maintainable code. This article lists the guidelines to be followed to write a readable code. Although we write efficient codes, we sometimes forget one aspect of coding ie. readability. Read this article, and also dont miss out the comments too.