Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the skills for using ASP.NET controls?

Shulou Source: shulou.com Published: 2022-06-02 18:41:35 10月06日 Update

Editor to share with you what skills to use ASP.NET controls, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

◆ ASP.NET controls use server-side controls only when necessary

A new type of control called Web Server Controls, which runs on the server side, has been introduced in ASP.NET, and they are often explained in code by the following syntax:

They are sometimes called ASP controls. The server-side control is indicated by the runat property, and its value is always "server".

By adding the runat property, a general HTML control can be easily converted to run on the server side. Here is a simple example:

Through the name specified in the id property, we can refer to the control in the program, and we can set the property and get the value programmatically, so the server-side processing method is more flexible.

This flexibility comes at a price. Each server-side control consumes resources on the server. In addition, unless the control, web page, or application explicitly forbids view state, the state of the control is contained in the hidden domain of view state and is passed on each echo, which can cause serious performance degradation.

A good example of this is the application of a control table on a web page that uses an HTML table that does not require server-side processing if it does not need to reference elements in the table in code. We can still place the server control in the HTML table cell and reference the server control in the code. If you need to reference any table element, such as a specified cell, the entire table must be a server control.

The difference between HyperLink Control and LinkButton Control used by ◆ ASP.NET Control

For Web visitors, HyperLink and LinkButton controls are the same, but they are still quite different in terms of functionality.

When the user clicks on the control, the HyperLink control immediately "navigates" the user to the target URL, and the watch is not sent back to the server. The LinkButton control first sends the watch back to the server, and then navigates the user to the target URL. Use the LinkButton control if server-side processing is required before reaching the target URL, or the HyperLink control if server-side processing is not required

These are all the contents of the article "what are the tips for using ASP.NET controls?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Controls servers services tables properties processing code users goals articles tips skills larger examples elements content units available through way flexibility Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Xiaomi OPPO Reno NVidia vpn