i want to know that why we use code behid approch. if there is some advantage then plese share to 开发者_StackOverflow中文版me ? as we know that there is two methode for writing server side code for aspx.file
- code-behind approch in which we usually we seprate our server code aspx.cs file from aspx file
- we can directly write server side code in aspx page by writing //server side codebefore html tag ?
so i wnat to know that is ther any authentic reasion which provide advatage in code-behind approch.
You should strive to separate UI layout from UI or business logic. Those who use codebehind benefit from the advantages of compile-time warnings, type safety, and better debugging support.
Check this article - https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-1049844.html
EDITED: this one is helpful too to give information of code-behind pages - http://www.java-samples.com/showtutorial.php?tutorialid=1084
It helps prevent spaghetti code with a mix of markup and code, which is hard to maintain and review.
精彩评论