Programming Asp.net note-Chapter 3 controls: Fundamental concepts

Source: Internet
Author: User

1. Four web control types:

HTML controls, HTML server controls, ASP. NET Server controls, user controls, and custom controls.

The ASP. NET controls include:

Form element controls (Textbox, button, label, checkbox ...)

Verify controls

Data Source Control,

Data View Control

Personalized controls

Login controls and security controls

Masterpage

Rich control rich controls.

 

2.asp.net executionProgramThe mode is the event-driven mode, and the server control is an object that can be used to initiate events.

Asp.net events: event messages are sent to the server through httppost.

General prototype of the event:

Private void eventname (Object sender, eventargs E );

 

Application and session events; page and control events;

PostBack versus non-PostBack events. The callback event enables the form to be immediately returned to the server.

Ispostback: Indicates whether to load the page when it is loaded for the first time or when it is returned by the client.

 

3. Use an event handler for multiple controls:

Test the sender implementation

Private void btnclick (Object sender, eventargs E)

{

Button B = sender as button;

String bid = B. ID;

Switch (BID)

{

Case "X": // set the length to three;

Case "Y": // do something.

}

}

The book says it can reduce repetitionCodeTo make the program easy to read and maintain.

4. Properly structured XHTML

Disable all tags, prohibit tag nesting, case-insensitive (Asp.net is not distinguished, C # is distinguished), attribute values are quoted, unique root element <HTML>, keep characters.

5. Asp.net and browsers

Asp.net server controls is processed by the server side and sent to the standard HTML browser.

 

6. html server controls

To run in ASP. NET, convert the existing HTML page (add the runat attribute)

Practical HTML table for page layout

7. Client Processing

Use the javascipt or vascript script.

<Script language = JavaScript>

Function dosomething ()

{

Document. getelementbyid ("btnsave"). Disabled = false;

}

</SCRIPT>

 

 

 

 

 

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.