30. November 2010 19:04
As we all know, with the release of ASP.net 2.0, it has become quite easy to create uniform layout across almost all the pages on a website. Let us look at some brief of the ASP.net master pages here in this article.
In order to create uniform pages across the website, a user needs to create only one master page which can characterize the look, feel and typical behavior of all the pages across the website. After that, individual content pages can be created with the given look and feel with required content on the page. Thus, while user requests for the content page, ASP.net merges it with the master page to create a combine page of defined layout and content.
Just like master pages, there exists a feature called dynamic web template. However, it is advised to use master pages while using the ASP.net to give a consistent look across the website with the share content pages. And if a user is working with the HTML files, it is advisable to use the dynamic web templates.
Benefits of Using Master Pages
Let us now look at the benefits of using the master pages in the ASP.net files which can convince a user to use the master pages in website. Traditionally, it was defined to copy all the code from one page to another page in order to create uniform pages across the website but master page has overtaken this duty to make it quite simple for a user. The benefits include:
- Master page allows unifying the common functionality required in all the pages so user only has to update a single page.
- Master page allows to create only single set of controls which can be applied to the pages across the website.
- With this, it also provides such a model object through which user can modify the master page through the individual content page.
23. November 2010 20:07
I recently had a project where I had to copy paste code from bunch of other projects that we had worked on. As a results the code was really not aligned in terms of tab indentation. As we follow a company wide standard for the code alignment, this was going to be a problem. But Visual Studio came to the rescue. Simply select the code block that you want to indent properly and then press CTRL+K followed by CTRL+D. Voila! The code is now nicely indented.