C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Best ASP.NET coding practices


Posted Date: 30 Jun 2009    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 15



1. Use Master Pages.
Why?
For keeping UI consistency in earlier version different User controls were created and included in different pages. A master page is a template for other pages, with shared layout and functionality. The master page defines placeholders for content pages. The result page is a combination (merge) of the master page and the content page. So for applying a consistent look and feel for a whole web site Master pages is used in .Net .

2. Use Themes and Skins.
Why?
Themes is another feature of ASP.NET . Themes, or skins, allow developers to create a customized look for web applications. Using Themes, it makes simple to customize the appearance of a site and all visual elements can be customized. Themes can be applied to controls, pages, and entire sites.

3. Use separate files for JavaScript functions and include in Master pages.
Why?
It saves repetition of same JavaScript function in different files.

4. Use SiteMaps..
Why?
It saves time of coding for navigation from one page to another page in a web application.

5. Use a common Exception Handling page..
Why?
If any exception occur, catch it and redirect to a common Exception Handling page with exception details and Page name and display this information in user friendly manner in this Exception Handling page.

6. Use Web Parts..
Why?
Web Parts provides a consistent look for a site, while still allowing user customization of style and content. It contains Zone controls (areas on a page where the content is consistent) and Web part controls (content areas for each zone) which are new in .Net .


7. Use Login Controls..
Why?
Security is very important for protecting confi dential and personal information.

8. Place all code (.cs) fi les and dlls used, in App_Code folder..
Why?
In .Net , during compilation fi rst it compile code of code fi les resides in App_Code folder, so there will be no need to make reference of them.

9. Use bulk copy classes for bulk copying of data (e.g. SqlBulkCopy class in SQL .Net)..
Why?
Bulk copy classes provides the fastest way to transfer set of data from once
source to the other.

Benefits.
1. It helps to improve consistency and readability of code.
2. Error free work and helps to maintain the applications.
3. To improve the performance and reduce the code.



Responses

Author: Prasoon Kumar    01 Jul 2009Member Level: Silver   Points : 1
Hi
Good one Viji ..

here is one suggestion to you :-

Try to include code snippet as an example in all of you article.

like as a "Use a common Exception Handling page"

if i can have the code for that that will help me much

better.

Regards
Prasoon.




Author: Viji RAJKUMAR    01 Jul 2009Member Level: Diamond   Points : 1
Hello Prasoon

Thanks Will include ur suggestion, when i post it in the codes and snippets category.



Regards

Viji Rajkumar
http://vijirajkumar.blogspot.com


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Best ASP.NET coding practices  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Accessing the data of ASP.NET templated controls from client-side script
Previous Resource: SilverLight for Beginners
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use