After the Asp.net Textbox Control is set to readonly, it cannot be returned.

Source: Internet
Author: User

It is strange that such a strange problem has never been encountered before. It can be normal on other machines and may be related to the ASP. NET version.
I use ASP. NET 2.0. When it is changed to ASP. NET 1.0, it will be normal. The Textbox Control readonly = true can be returned.
In ASP. NET 1.0, readonly = true will be returned.
In ASP. NET 2.0, if readonly = true, it will not be returned.

Solution:
<Asp: textbox id = "username" runat = "server" readonly = "true"> </ASP: textbox>
Remove readonly = "true" and change it
<Asp: textbox id = "username" runat = "server"> </ASP: textbox>

In the backgroundCodeTo control read-only attributes.
Username. Attributes. Add ("readonly", "true ");
In this way, the Textbox Control read-only in ASP. NET 2.0 can also be returned.

Related Article

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.