Asp.net Binding

mybwu_com發表於2013-12-24

Asp.net binding

Single value binding

Way 1:

Step 1: <%# EmployeeName %>

Step 2: callPage.DataBind();

Single value binding can be applied to :

a.property

b.member

c.return value of a method

Way 2:

Step 1:<asp:literalControl Text=”<%$ someValue %” />

Note :

a.No need call page.DataBind()

b.Must used in asp control

Repeated value binding

Set : DataTextField / DataValueField

Can bind to :

a.Collections

b.Data reader

c.Data view


Data source control life cycle :

·Page object created

·Page.init

·Page.load

·Control event raise

·Data source control perform update

·Pre_render

·Insert data into linked controls , fire selecting / selected event

·Render

相關文章