WebForm simple controls and the use of repeater

Source: Internet
Author: User

A

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

<%%>-writing C # code

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

<%#%>-use in repeater data display

(ii) Repeater data display

1.HeaderTemplate---executed first, once

FooterTemplate---After execution, once

ItemTemplate---Executed after the header, how many data bindings are executed as many times

AlternatingItemTemplate---Alternating item template, alternating with itemtemple

<%# Eval ("Property name", "optional, format string")%>

<%# method Name ()%>

Data binding shows the Code interface layer:

View Code

C # code layer:

list<users> ulist = new Usersdata (). SelectAll ();        Repeater1.datasource = ulist;        Repeater1.databind ();

(c) Simple controls

1.Lable--turn into 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" >

(d) Click events for buttons

Write with event delegates, in Page_Load in the code layer

WebForm simple controls and the use of repeater

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.