Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,


I need a clarification on Difference between writing all Codes in Code Behind File and
making Class separating DAL and BAL. I googled But Couldn't get Clear Idea.
Which is best and Why?


Regards,
Pal.
Posted

Follow all the links provided here : ASP.Net 3-Tier architecture[^] and Understand 3- Tier Architecture in C#[^] and you will definitely be clear.

Regards..
 
Share this answer
 
v2
Writing all code in code-behind is ugly thing. Massive code in single file(in a page) will make things harder. Tough to debug.

Seperate classes for some code(like DB related, generic) is for code reusability, maintainability. And easy for debugging. While migration this way is easy, because you have seperated things in seperate classes/layers so you'll have to develop only UI related things.

Here a sample article
Creating ASP.NET Applications with N-Tier Architecture[^]
And also take a look at MVC[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900