The ASP. NET button control uses JS disabled

Source: Internet
Author: User

Today, I want to use JS to disable the button control of ASP, check for a long time, are a line of code ....

document.getElementById ("Button1"). Disabled = ' disabled ';

Tried a lot of methods, do not work, accidentally found that only the button control Usesubmitbehavior property to false; Ojbk.

In ASP. NET, the button's Usesubmitbehavior property defaults to True. When True, the type is "submit" by default, and False is the "button" type ...

Use the Usesubmitbehavior property to specify whether the Button control uses the client browser's commit mechanism or the ASP. By default, this property has a value of true, which causes the Button control to use the browser's commit mechanism. If False is specified, the ASP. NET page framework adds client script to the page to send the form to the server.

PS (Nothing to do, not to find the way is no turning)

The ASP. NET button control uses JS disabled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.