Application background When users need a certain function, they need to fill in some form information. After filling in and submitting, this part of the information is not allowed to be modified again. The form contains TextBox, DropDownList, CheckBox and other controls.
Requirement realization
The first solution is to set the Enable property of the control to False when binding the data filled in by the user. This method can be used if the number of forms on the page is small, but it is not a better method if there are many forms.
The second option is to use Foreach to access the page control. If the type is TextBox, DropDownList, CheckBox, etc., set Enable=False. The amount of code is reduced compared to the first solution, but it is still not optimal.
The third option can be easily implemented using Jquery.
$("input").attr( "disabled", "disabled");
Summary
There are many ways to achieve the same function. How to find a faster way in specific scenarios? The more suitable one, that's what we want.