DEV Community

Cover image for Cleaner Structure in WebForms Core 2
Elanat Framework
Elanat Framework

Posted on

Cleaner Structure in WebForms Core 2

We at Elanat are working on version 2 of the WebForms Core technology.

In version 2, we added support for HTML comments instead of the web-forms tag; however, we still kept the web-forms tag. Also, in CodeBehind version 4.4, using the Control method writes the Action Control at the end of the HTML instead of adding the web-forms tag at the end of the HTML. This new structure helps to create a more structured and standardized initial request with HTML.

Example:

Using the web-forms tag in previous versions

...
</main>

</body>
</html>
<web-forms ac="EeButton1=onclick|/sse/event1|1|3000$[sln];EeButton2=onclick|/sse/event2|1|3000"></web-forms>
Enter fullscreen mode Exit fullscreen mode

In this case, if the web-forms tag is added after the closing html tag, the browser will object to it and it is not standard.

Using HTML Comments in Version 2

...
</main>

</body>
</html>
<!--[web-forms]
EeButton1=onclick|/sse/event1|1|3000
EeButton2=onclick|/sse/event2|1|3000-->
Enter fullscreen mode Exit fullscreen mode

As you can see, Action Controls are also included in the HTML in secondary requests, just as they are sent in secondary requests.

We will provide more information about version 2 of WebForms Core technology in the coming days.

Top comments (0)