WebForm and WebForm in repeater controls, simple controls using

Source: Internet
Author: User

Asp. NET divided into: ASP. WebForm and ASP.

Operating mechanism:

c/S (client application) code is executed on the client, just go to the database on the server to access data

b/S (website application) program code executes on the server, the client only renders HTML+CSS, executes the JS code, all other functions are executed on the server

The client browser sends the request → IIS (Internet Information Services Manager) on the server (HTML+CSS+JS) →. NET framwork on the server for code processing → databases on the server

Why the web is becoming more and more popular

1, do not eat the user's computer Configuration

2, no need to install, anytime and anywhere access to the Web

3. Cross-platform

Second, Repeater control

1. <%@%>-There are some statements and references in this

<%%>-writing C # code

<%=%>-Outputs the value of a variable to the interface

<%# Eval ("attribute name", "optional, format string")%>-used in repeater data presentation

<% #Eval ("Birthday", "{0:yyyy mm month DD day}")%>

2. Repeater control-used to show data repeat execution.

<HeaderTemplate></HeaderTemplate> perform first, once, often to show the table header

<ItemTemplate></ItemTemplate> executes after <HeaderTemplate></HeaderTemplate> to bind the data, how many times the data is executed.

<AlternatingItemTemplate></AlternatingItemTemplate> alternating item templates, with <itemtemplate></itemtemplate > Alternate execution.

<FooterTemplate></FooterTemplate> last executed, executed once

3. Data binding

Data binding in the Background code page load

Three, simple controls

1.Lable-Convert to <span></span>

You need to add display:inline-block to the style to be a long-width function in the lable style

2.Literal-Empty, nothing to convert, print content directly on the interface

Function: Can directly output the above content,

Literal.text=<script>alter (' hello ');</script>---can jump out of the popup window directly on the interface

3.TextBox

Set Property TextMode

Singline---into <input type= "text"/>

PassWord---into <input type= "PassWord" >

MultiLine---into <textarea>

4.HiddenField---into <input type= "hidden" >

5.Button---becomes <input type= "Submit" >

6.ImageButton---into <input type= "image" >

To write an event with a delegate:

For example:

The Click event of the Write button in the background code interface load + =, then double-click the TAB key will generate the corresponding Click event

WebForm and WebForm in repeater controls, simple controls using

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.