DEV Community

Cover image for Should We Return Web-Form Controls to ASP.NET Core?

Posted on

Should We Return Web-Form Controls to ASP.NET Core?

What is Web-Form

Web-form controls are parts of web pages that are built based on the ASP.NET Standard. Web-form controls are tags that increase the ease of programming. Each of these controls are classes with their own attributes and methods.

These controls were very attractive to desktop programmers. To create a web page in Visual Studio, programmers would create a new project and just drag and drop the web form controls to the page.

List of popular controls:

  • Label
  • Text Box
  • Button
  • Checkbox
  • Radio Button
  • List Box
  • Check Box List
  • File Upload

The image below shows an example of controls.

Example of controls

The use of these types of controls is very less in the web and in the new versions of ASP.NET Core, it is not a happy news for web-form programmers in ASP.NET Standard; On the desktop, it is only used for non-graphical management programs.

Example control in Web-Form

<asp:TextBox ID="TextBox1" Text="Guest" runat="server"></asp:TextBox>
<asp:Button ID="Button1" Text="Button" OnClick="Button1_Click" runat="server" />
Enter fullscreen mode Exit fullscreen mode

In the code above, the first line is a textbox control and the second line is a button control.

Click example

protected void Button1_Click(object sender, EventArgs e)
    TextBox1.Text = TextBox1.Text + " , welcome to Web-For control!";
Enter fullscreen mode Exit fullscreen mode

The code above is a simple example of the function of counters in web-forms. In the example above, after clicking Button1, a string is added to the TextBox1 string.

For events where the response is applied on the same page, web developers use Ajax or Fetch.

We at Elanat team have provided a CodeBehind framework to compete with the default structure of cshtml pages in ASP.NET Core. It's been eight months since CodeBehind was launched and we're constantly adding new features with new updates. View pages in the CodeBehind framework have an aspx extension; Of course, the CodeBehind framework has nothing to do with web-forms. CodeBehind is a new and modern framework built for deployment on ASP.NETCore.

We want to know if we need to add the possibility to add web controls in the CodeBehind framework.

  • If we add this feature, should the structure of the CodeBehind framework controls be similar to the former web-form controls?
  • Should we use viewstate or do you consider it unnecessary?
  • Should we use Ajax and Fetch behind controls without user involvement?
  • Should we require JavaScript to be active or still submit the form?

Please share with us and other users your thoughts on the return of web controls to ASP.NET Core.

Top comments (0)