We know that ASP.NET WebForms is a very modern design pattern that decouples code (HTML, CS, JS, CSS and SQL). With this approach, it helps developers to control, reuse, upgrade and maintain the code easily. It also helps developer to write their code natively.
We can use ASP.NET WebForms to build a Template Control with less effort but it is very native, flexible, performance and powerful:
It can be used to view news:
It can be used to view product:
It can also be used to export to json format (a very common format currently):
It can also be used to create an input form:
It can be used to create a slideshow easily:
It can be used to export to xml format:
It can be used to create Template Control easily:
Although it is used for multiple purposes, it is very easy to use and flexible technology. Code behind (C#) is also very simple. We can process every business logic with just a few lines of code.
Template Control will automatically bind the data in a fairly simple structure as shown below without adding any lines of code. It relies on httpContext, menu_url and menu_data to determine the data to process.
As you can see, the code (HTML, CS and SQL) is decoupled completely. We can write the code independently without fearing of conflict (When we modify code in C#, we also do not care much about mixing up code between HTML and SQL). We can control the code completely without worrying about the system generating arbitrary code. We can test our code very easy. It renders code by block so it runs very fast and use less server resources. We can also control the cache completely so we can make adjustment to optimize the system to help it run faster. Code is very native so it is easy to control exception and manage code. Especially, it is easy to reuse, upgrade, maintain. Those are vital factors in software development.
Template technology eliminates all limitations (ViewState, SessionState, DrivenEvent, PostBack, PageLifeCycle, MasterPage, etc.) of WebForms and promotes all of its strengths (simple, clear, native, flexible, performance, powerful, etc.). Consequently, if WebForms applies Template, it will help WebForms become the most wonderful programming technology out of current programming technologies.
KhaLa Company has applied this technology for more than 10 years. It helps us to shorten the project duration from 2 months to 2 days. Although we use VPS (Virtual Private Server) server that has very low configuration (2 Cores, 3GB RAM) but we can still install hundreds of apps that running very fast (response time <100 ms). It can also respond hundreds of thousands of requests simultaneously. Besides, the upgraded capability (add, edit, delete: module, business logic, etc.) is simple and fast without modifying the code, without restarting the app, without interrupting the running system.
In short, we hope that Microsoft will take a serious consideration to upgrade WebForms technology and integrate into .Net Core soon so that it can run on cross platform. And of course, Microsoft should improve this technology by removing the limitations and remove the word "runat" for the simple and clear code.
We just provide some basic examples in this article. However, there are many wonderful functions in reality.
Thank you for taking your time to read this article!
Khi nói đến Web Forms, rất nhiều người nghĩ rằng nó có viewstate, drivenevents khó kiểm soát. Nhưng có lẽ ít người biết đến Web Forms hỗ trợ công nghệ lập trình Template rất hiện đại, rất đơn giản và rất linh động mà không dùng tới viewstate, drivenevents.
WebForms is a very modern, simple, clear, flexible, decouple design pattern model. It was one of Microsoft's wonderful technologies, but unluckily it has been gradually oblivion recently.
WebForms là mô hình lập trình rất hiện đại, đơn giản, rỏ ràng, linh động, hoạt động độc lập, không còn trộn code… Là một trong những công nghệ độc đáo của Microsoft dưới thời Bill Gates, nhưng gần đây nó dần bị lãng quên thật đáng tiếc.