Javascript.net properties

Could you compare the properties

I want to disable the text field "txtName". There are two ways:

  • Use javascript, txtName.disabled = true
  • Use ASP.NET, <.. Enabled="false" ..>

Which method is better and why?

+3
source share
3 answers

I assume that Enabled="false"results disabled="disabled"in the generated HTML code. In this case, this is by far the best way, since it does not require the user to enable JavaScript.

+1
source

If you want to disable the button, the server-side method will require feedback (page feed back, triggering event handlers, response).

The client-side method (javascript) does not require this.

, javascript , .

( disabled).

+1

.

-2

Source: https://habr.com/ru/post/1778294/


All Articles