Powerful Asp.net binding component

Source: Internet
Author: User
The data set binding method databinder. Eval of Asp.net is not easy to use. It does not support child entity binding or enumeration escape binding. In short, it is not very easy to use, so I have to be comfortable with myself,

Component download: http://files.cnblogs.com/zhouyongguo/testLogon.rar

Page html Code Formula: < Table border = 1 >
< Tr >
< TD > Name </ TD >
< TD > Review </ TD >
< TD > Date </ TD >
< TD > Others </ TD >
</ Tr >
< ASP: repeater ID = " Repeater1 " Runat = " Server " >
< Itemtemplate >
< Tr >
< TD > <% # Great. mybinder. eval (container. dataitem, " Title " ) %> </ TD >
< TD > <% # Great. mybinder. evealenum (container. dataitem, " Isauditing " , New   String [] {"Review","Not reviewed"} ) %> </ TD >
< TD > <% # Great. mybinder. evaldate (container. dataitem, " Createdate " , True ) %> </ TD >
< TD > <% # Great. mybinder. eval (container. dataitem, " File. Name " ) %> </ TD >
</ Tr >
</ Itemtemplate >
</ ASP: Repeater >
</ Table >

<% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> <% # Great. mybinder. eval (container. dataitem, "file. name ") %> file. name can always be clicked, for example, file. name ..., private fields can be bound, and enumeration boolean values can be escaped.

Code:

1 Private   Void Page_load ( Object Sender, system. eventargs E)
2 {
3This. Repeater1.datasource=Getlist ();
4This. Repeater1.databind ();
5}
6
7 Private Arraylist getlist ()
8 {
9 System. Collections. arraylist list = New Arraylist ();
10 Doc = New DOC (system. datetime. Now );
11 Doc. Title = " Plan " ;
12 Doc. File = New File ( " Fujian " );
13 List. Add (DOC );
14
15 Doc doc1 = New DOC ( New Datetime ( 2004 , 4 , 6 ));
16 Doc1.title = " Report " ;
17 Doc1.isauditing = True ;
18 Doc1.file = New File ( " Beijing " );
19 List. Add (doc1 );
20 Return List;
21
22 }

Entity:

Public   Class Doc
{
String _ Title = "" ;
Public   String Title
{
Get {Return This. _ Title ;}
Set {This. _ Title=Value ;}
}

Public File file;

Private System. datetime createdate = System. datetime. now;

Public   Bool Isauditing = False ;
Public DOC ()
{
}

Public DOC (system. datetime createdate)
{
Createdate=Createdate;
}
}

Public   Class File
{
Private   String Name = "" ;
Public File ( String Name)
{
This. Name=Name;

}
}

FromZhouyongguo

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.