Asp.net notes (2)

Source: Internet
Author: User

1. When using functions and members in Cs IN aspx, note that the function type is protected or public.

2. The server control and client Control ID of Asp.net are not necessarily the same. Server controls are easy to use in the intranet and background environments. The HTML control is used in the foreground. Make the best use of all things.

3. method for obtaining client Control ID: Server ID. clientid

Document. getelementbyid ('<% = textbox1.clientid %> ')

The same applies to jquery.

4. CSS style of the ASP label control in aspx: cssclass = "...", Equivalent to the class attribute in HTML. You can also modify the control style separately, but it is not recommended to do so. Will generate a large number of RedundancyCode.

5. attributes of the control is used to set additional properties of the control.

6. The label is rendered as span. If the associatecontrolid attribute is set, it is rendered as a label and the for attribute is the associated control ID.

7. Literal does not render any text. After the mode attribute is set to encode, the text can be automatically encoded to prevent XSS vulnerabilities.

8. When the autopostback attribute of the Textbox Control is true, the control will post automatically when it loses focus. The _ dopostback () method is recommended when submitting a form in Asp.net.

9. radiobutton is rendered as input type = "radio" and grouped by groupname.

10. Buttons and other controls can be processed in a unified manner through command, commandname, and commandargument.

11. panel is a container. If the groupingtext attribute is set, it is rendered as a div with a filedset. Otherwise, it is directly a div.

12. hyperlink can convert a virtual path to a client path.

13. Instructions for using the fileupload control: You need to increase the type and permissions of the file to be uploaded. Prevents malicious attacks.

14. jquery usage notes: $ ("# <% = textbox1.clientid %>"). Val () Only the server code is in <%>.

15. Both display: none and visibility: hidden of the control can be hidden. The difference is that display: None does not occupy space.

16. The isvalid attribute on the page is used to determine whether all verification controls have been verified.

17. If the causesvilidation attribute of the control is false, the control cannot be verified by the control.

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.