ASP. NET binding Techniques

Source: Internet
Author: User
Keywords I'm going to publish this the grammar the reborn
Tags .net asp asp.net can make class code data net

Data binding seems to be ASP.net's oldest program, nothing more than an eval stream. In fact, a little processing can make it anew.

Add in code:

The recommendation is placed on the base class protected virtual object exphelper<tentity, tresult> (func<tentity, tresult> Func) {var itm = Getdataitem (); return func ((tentity) ITM); Student is the data class protected object Stu<tresult> (Func<student, tresult> Func) {return exphelper<student, Tresult> (func);

So you can use a strongly typed eval on the ASPX page.

<table> <asp:repeater runat= "Server" > <ItemTemplate> <tr> <td> <% #Stu (_=>_. Id)%> </td> <td> <% #Stu (_=>_. User.Name)%> </td> </tr> </ItemTemplate> </asp:Repeater></table>

Because it is not reflective, performance is greatly improved and the syntax is IntelliSense, cool.

I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!! I want to release!!
Related Article

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.