Repeater控件

简介:

    Repeater控件和DataList控件,可以用来一次显示一组数据项。比如,可以用它们显示一个数据表中的所有行。  
    Repeater控件完全由模板驱动,提供了最大的灵活性,可以任意设置它的输出格式。DataList控件也由模板驱动,和Repeater不同的是,DataList默认输出是HTML表格,DataList将数据源中的记录输出为HTML表格一个个的单元格 。


1、Repeater支持以下5种模板:

      ● ItemTemplate : 对每一个数据项进行格式设置 (包含要为数据源中每个数据项都要呈现一次的 HTML 元素和控件。)。 
      ● AlternatingItemTemplate : 对交替数据项进行格式设置(包含要为数据源中每个数据项都要呈现一次的 HTML 元素和控件。)。 
      ● SeparatorTemplate : 对分隔符进行格式设置(包含在每项之间呈现的元素。)。 
      ● HeaderTemplate : 对页眉进行格式设置(包含在列表的开始处分别呈现的文本和控件。)。 
      ● FooterTemplate : 对页脚进行格式设置(包含在列表的结束处分别呈现的文本和控件。)。

示例一:(基本演示)

aspx页面:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RepeaterDemo._Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7.     <title></title>  
  8. </head>  
  9. <body>  
  10.     <form id="form1" runat="server">  
  11.     <div>  
  12.       
  13.         <asp:Repeater ID="rptPeople" runat="server">  
  14.             <HeaderTemplate>  
  15.             <table border="1">  
  16.                 <tr>  
  17.                     <td>姓名</td>  
  18.                     <td>年龄</td>  
  19.                     <td>性别</td>  
  20.                 </tr>  
  21.             </HeaderTemplate>  
  22.             <ItemTemplate>  
  23.                 <tr>  
  24.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  25.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  26.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  27.                 </tr>  
  28.             </ItemTemplate>  
  29.             <FooterTemplate>  
  30.             </table>  
  31.             </FooterTemplate>  
  32.         </asp:Repeater>  
  33.       
  34.     </div>  
  35.     </form>  
  36. </body>  
  37. </html>  

cs页面:

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Web;  
  4. using System.Web.UI;  
  5. using System.Web.UI.WebControls;  
  6.   
  7. namespace RepeaterDemo  
  8. {  
  9.     public partial class _Default : System.Web.UI.Page  
  10.     {  
  11.         protected void Page_Load(object sender, EventArgs e)  
  12.         {  
  13.             List<People> peopleList = new List<People>();  
  14.             peopleList.Add(new People("韩兆新",24,Sex.男));  
  15.             peopleList.Add(new People("XXXX", 25, Sex.女));  
  16.             peopleList.Add(new People("YYYY", 20, Sex.男));  
  17.             peopleList.Add(new People("ZZZZ", 23, Sex.男));  
  18.             peopleList.Add(new People("AAAA", 23, Sex.女));  
  19.             peopleList.Add(new People("BBBB", 18, Sex.女));  
  20.   
  21.             rptPeople.DataSource = peopleList;  
  22.             rptPeople.DataBind();  
  23.         }  
  24.     }  
  25.     public enum Sex  
  26.     {   
  27.         男 = 2,  
  28.         女 = 1,  
  29.     };  
  30.     public class People  
  31.     {  
  32.         public People(string name, uint age, Sex sex)  
  33.         {  
  34.             this.Name = name;  
  35.             this.Age = age;  
  36.             this.Sex = sex;  
  37.         }  
  38.           
  39.          
  40.         public string Name  
  41.         {get;set;}  
  42.         public uint Age  
  43.         { getprivate set; }  
  44.         public Sex Sex  
  45.         { getprivate set; }  
  46.   
  47.     }  
  48. }  

示例二:(AlternatingItemTemplate 模板)

aspx页面:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RepeaterDemo._Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7.     <title></title>  
  8. </head>  
  9. <body>  
  10.     <form id="form1" runat="server">  
  11.     <div>  
  12.       
  13.         <asp:Repeater ID="rptPeople" runat="server">  
  14.             <HeaderTemplate>  
  15.             <table border="1">  
  16.                 <tr>  
  17.                     <td>姓名</td>  
  18.                     <td>年龄</td>  
  19.                     <td>性别</td>  
  20.                 </tr>  
  21.             </HeaderTemplate>  
  22.             <ItemTemplate>  
  23.                 <tr>  
  24.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  25.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  26.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  27.                 </tr>  
  28.             </ItemTemplate>  
  29.             <AlternatingItemTemplate>  
  30.                 <tr style="background:gray">  
  31.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  32.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  33.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  34.                 </tr>  
  35.             </AlternatingItemTemplate>  
  36.             <FooterTemplate>  
  37.             </table>  
  38.             </FooterTemplate>  
  39.         </asp:Repeater>  
  40.       
  41.     </div>  
  42.     </form>  
  43. </body>  
  44. </html>  

示例三:(SeparatorTemplate模板)

aspx页面:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RepeaterDemo._Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7.     <title></title>  
  8. </head>  
  9. <body>  
  10.     <form id="form1" runat="server">  
  11.     <div>  
  12.       
  13.         <asp:Repeater ID="rptPeople" runat="server">  
  14.             <HeaderTemplate>  
  15.             <table border="1">  
  16.                 <tr>  
  17.                     <td>姓名</td>  
  18.                     <td>年龄</td>  
  19.                     <td>性别</td>  
  20.                 </tr>  
  21.             </HeaderTemplate>  
  22.             <ItemTemplate>  
  23.                 <tr>  
  24.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  25.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  26.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  27.                 </tr>  
  28.             </ItemTemplate>  
  29.             <AlternatingItemTemplate>  
  30.                 <tr style="background:gray">  
  31.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  32.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  33.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  34.                 </tr>  
  35.             </AlternatingItemTemplate>  
  36.             <SeparatorTemplate>  
  37.                 <tr style="background:red">  
  38.                     <td>123</td>  
  39.                 </tr>  
  40.             </SeparatorTemplate>  
  41.             <FooterTemplate>  
  42.             </table>  
  43.             </FooterTemplate>  
  44.         </asp:Repeater>  
  45.       
  46.     </div>  
  47.     </form>  
  48. </body>  
  49. </html>  

2、Repeater控件的嵌套:

示例一:(Repeater控件嵌套演示:操作子Repeater控件)

aspx页面:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RepeaterDemo._Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7.     <title></title>  
  8. </head>  
  9. <body>  
  10.     <form id="form1" runat="server">  
  11.     <div>  
  12.       
  13.         <asp:Repeater ID="rptPeople" runat="server"   
  14.             onitemdatabound="rptPeople_ItemDataBound">  
  15.             <HeaderTemplate>  
  16.             <table border="1">  
  17.                 <tr>  
  18.                     <td>姓名</td>  
  19.                     <td>年龄</td>  
  20.                     <td>性别</td>  
  21.                     <td>书籍类别</td>  
  22.                     <td>书籍名称</td>  
  23.                 </tr>  
  24.             </HeaderTemplate>  
  25.             <ItemTemplate>  
  26.                 <tr>  
  27.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  28.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  29.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  30.                     <td>  
  31.                         <table>  
  32.                             <tr><td>文学类:</td></tr>  
  33.                             <tr><td>科学类:</td></tr>  
  34.                             <tr><td>哲学类:</td></tr>  
  35.                         </table>  
  36.                     </td>  
  37.                     <td>  
  38.                         <table>  
  39.                             <tr>  
  40.                             <asp:Repeater ID="rptLiterary" runat="server">  
  41.                                 <ItemTemplate>  
  42.                                 <td><%#Container.DataItem %></td>  
  43.                                 </ItemTemplate>  
  44.                             </asp:Repeater>  
  45.                             </tr>  
  46.                             <tr>  
  47.                             <asp:Repeater ID="rptScientific" runat="server">  
  48.                                 <ItemTemplate>  
  49.                                 <td><%#Container.DataItem %></td>  
  50.                                 </ItemTemplate>  
  51.                             </asp:Repeater>  
  52.                             </tr>  
  53.                             <tr>  
  54.                             <asp:Repeater ID="rptPhilosophic" runat="server">  
  55.                                 <ItemTemplate>  
  56.                                 <td><%#Container.DataItem %></td>  
  57.                                 </ItemTemplate>  
  58.                             </asp:Repeater>  
  59.                             </tr>  
  60.                         </table>  
  61.                     </td>  
  62.                 </tr>  
  63.             </ItemTemplate>  
  64.             <AlternatingItemTemplate>  
  65.                 <tr style="background:gray">  
  66.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  67.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  68.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  69.                     <td>  
  70.                         <table>  
  71.                             <tr><td>文学类:</td></tr>  
  72.                             <tr><td>科学类:</td></tr>  
  73.                             <tr><td>哲学类:</td></tr>  
  74.                         </table>  
  75.                     </td>  
  76.                     <td>  
  77.                         <table>  
  78.                             <tr>  
  79.                             <asp:Repeater ID="rptLiterary" runat="server">  
  80.                                 <ItemTemplate>  
  81.                                 <td><%#Container.DataItem %></td>  
  82.                                 </ItemTemplate>  
  83.                             </asp:Repeater>  
  84.                             </tr>  
  85.                             <tr>  
  86.                             <asp:Repeater ID="rptScientific" runat="server">  
  87.                                 <ItemTemplate>  
  88.                                 <td><%#Container.DataItem %></td>  
  89.                                 </ItemTemplate>  
  90.                             </asp:Repeater>  
  91.                             </tr>  
  92.                             <tr>  
  93.                             <asp:Repeater ID="rptPhilosophic" runat="server">  
  94.                                 <ItemTemplate>  
  95.                                 <td><%#Container.DataItem %></td>  
  96.                                 </ItemTemplate>  
  97.                             </asp:Repeater>  
  98.                             </tr>  
  99.                         </table>  
  100.                     </td>  
  101.                 </tr>  
  102.             </AlternatingItemTemplate>  
  103.             <FooterTemplate>  
  104.             </table>  
  105.             </FooterTemplate>  
  106.         </asp:Repeater>  
  107.       
  108.     </div>  
  109.     </form>  
  110. </body>  
  111. </html>  

cs页面:

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Web;  
  4. using System.Web.UI;  
  5. using System.Web.UI.WebControls;  
  6.   
  7. namespace RepeaterDemo  
  8. {  
  9.     public partial class _Default : System.Web.UI.Page  
  10.     {  
  11.         protected void Page_Load(object sender, EventArgs e)  
  12.         {  
  13.             List<People> peopleList = new List<People>();  
  14.             peopleList.Add(new People("韩兆新",24,Sex.男));  
  15.             peopleList.Add(new People("XXXX", 25, Sex.女));  
  16.             peopleList.Add(new People("YYYY", 20, Sex.男));  
  17.             peopleList.Add(new People("ZZZZ", 23, Sex.男));  
  18.             peopleList.Add(new People("AAAA", 23, Sex.女));  
  19.             peopleList.Add(new People("BBBB", 18, Sex.女));  
  20.   
  21.             rptPeople.DataSource = peopleList;  
  22.             rptPeople.DataBind();  
  23.         }  
  24.   
  25.         protected void rptPeople_ItemDataBound(object sender, RepeaterItemEventArgs e)  
  26.         {  
  27.             if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)  
  28.             {  
  29.                 List<string> literaryList = new List<string>();  
  30.                 literaryList.Add("《借我一生》");  
  31.                 literaryList.Add("《追风筝的人》");  
  32.                 literaryList.Add("《山居笔记》");  
  33.                 List<string> scientificList = new List<string>();  
  34.                 scientificList.Add("《时间简史》");  
  35.                 scientificList.Add("《果壳中的宇宙》");  
  36.                 scientificList.Add("《时空的未来》");  
  37.                 List<string> philosophicList = new List<string>();  
  38.                 philosophicList.Add("《周易正义》");  
  39.                 philosophicList.Add("《苏菲的世界》");  
  40.                 philosophicList.Add("《理想国》");  
  41.   
  42.                 Repeater rptLiterary = e.Item.FindControl("rptLiterary") as Repeater;  
  43.                 rptLiterary.DataSource = literaryList;  
  44.                 rptLiterary.DataBind();  
  45.                 Repeater rptScientific = e.Item.FindControl("rptScientific") as Repeater;  
  46.                 rptScientific.DataSource = scientificList;  
  47.                 rptScientific.DataBind();  
  48.                 Repeater rptPhilosophic = e.Item.FindControl("rptPhilosophic") as Repeater;  
  49.                 rptPhilosophic.DataSource = philosophicList;  
  50.                 rptPhilosophic.DataBind();  
  51.             }  
  52.   
  53.         }  
  54.     }  
  55.     public enum Sex  
  56.     {   
  57.         男 = 2,  
  58.         女 = 1,  
  59.     };  
  60.     public class People  
  61.     {  
  62.         public People(string name, uint age, Sex sex)  
  63.         {  
  64.             this.Name = name;  
  65.             this.Age = age;  
  66.             this.Sex = sex;  
  67.         }  
  68.           
  69.          
  70.         public string Name  
  71.         {get;set;}  
  72.         public uint Age  
  73.         { get; private set; }  
  74.         public Sex Sex  
  75.         { get; private set; }  
  76.   
  77.     }  
  78. }  

示例二:(Repeater控件嵌套:获取父Repeater控件的值)

aspx页面:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RepeaterDemo._Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4.   
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7.     <title></title>  
  8. </head>  
  9. <body>  
  10.     <form id="form1" runat="server">  
  11.     <div>  
  12.       
  13.         <asp:Repeater ID="rptPeople" runat="server"   
  14.             onitemdatabound="rptPeople_ItemDataBound">  
  15.             <HeaderTemplate>  
  16.             <table border="1">  
  17.                 <tr>  
  18.                     <td>姓名</td>  
  19.                     <td>年龄</td>  
  20.                     <td>性别</td>  
  21.                     <td>书籍类别</td>  
  22.                     <td>书籍名称</td>  
  23.                 </tr>  
  24.             </HeaderTemplate>  
  25.             <ItemTemplate>  
  26.                 <tr>  
  27.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  28.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  29.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  30.                     <td>  
  31.                         <table>  
  32.                             <tr><td>文学类:</td></tr>  
  33.                             <tr><td>科学类:</td></tr>  
  34.                             <tr><td>哲学类:</td></tr>  
  35.                         </table>  
  36.                     </td>  
  37.                     <td>  
  38.                         <table>  
  39.                             <tr>  
  40.                             <asp:Repeater ID="rptLiterary" runat="server">  
  41.                                 <ItemTemplate>  
  42.                                 <td><%#Container.DataItem %></td>  
  43.                                 </ItemTemplate>  
  44.                             </asp:Repeater>  
  45.                             </tr>  
  46.                             <tr>  
  47.                             <asp:Repeater ID="rptScientific" runat="server">  
  48.                                 <ItemTemplate>  
  49.                                 <td><%#Container.DataItem %></td>  
  50.                                 </ItemTemplate>  
  51.                             </asp:Repeater>  
  52.                             </tr>  
  53.                             <tr>  
  54.                             <asp:Repeater ID="rptPhilosophic" runat="server">  
  55.                                 <ItemTemplate>  
  56.                                 <td><%#Container.DataItem %></td>  
  57.                                 </ItemTemplate>  
  58.                             </asp:Repeater>  
  59.                             </tr>  
  60.                         </table>  
  61.                     </td>  
  62.                 </tr>  
  63.             </ItemTemplate>  
  64.             <AlternatingItemTemplate>  
  65.                 <tr style="background:gray">  
  66.                     <td><%#DataBinder.Eval(Container.DataItem,"Name") %></td>  
  67.                     <td><%#DataBinder.Eval(Container.DataItem,"Age") %></td>  
  68.                     <td><%#DataBinder.Eval(Container.DataItem,"Sex") %></td>  
  69.                     <td>  
  70.                         <table>  
  71.                             <tr><td>文学类:</td></tr>  
  72.                             <tr><td>科学类:</td></tr>  
  73.                             <tr><td>哲学类:</td></tr>  
  74.                         </table>  
  75.                     </td>  
  76.                     <td>  
  77.                         <table>  
  78.                             <tr>  
  79.                             <asp:Repeater ID="rptLiterary" runat="server">  
  80.                                 <ItemTemplate>  
  81.                                 <td><%#Container.DataItem %></td>  
  82.                                 </ItemTemplate>  
  83.                             </asp:Repeater>  
  84.                             </tr>  
  85.                             <tr>  
  86.                             <asp:Repeater ID="rptScientific" runat="server">  
  87.                                 <ItemTemplate>  
  88.                                 <td><%#Container.DataItem %></td>  
  89.                                 </ItemTemplate>  
  90.                             </asp:Repeater>  
  91.                             </tr>  
  92.                             <tr>  
  93.                             <asp:Repeater ID="rptPhilosophic" runat="server">  
  94.                                 <ItemTemplate>  
  95.                                 <td><%#Container.DataItem %></td>  
  96.                                 </ItemTemplate>  
  97.                             </asp:Repeater>  
  98.                             </tr>  
  99.                         </table>  
  100.                     </td>  
  101.                 </tr>  
  102.             </AlternatingItemTemplate>  
  103.             <FooterTemplate>  
  104.             </table>  
  105.             </FooterTemplate>  
  106.         </asp:Repeater>  
  107.       
  108.     </div>  
  109.     </form>  
  110. </body>  
  111. </html>  

cs页面:

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Web;  
  4. using System.Web.UI;  
  5. using System.Web.UI.WebControls;  
  6.   
  7. namespace RepeaterDemo  
  8. {  
  9.     public partial class _Default : System.Web.UI.Page  
  10.     {  
  11.         protected void Page_Load(object sender, EventArgs e)  
  12.         {  
  13.             List<People> peopleList = new List<People>();  
  14.             peopleList.Add(new People("韩兆新",24,Sex.男));  
  15.             peopleList.Add(new People("XXXX", 25, Sex.女));  
  16.             peopleList.Add(new People("YYYY", 20, Sex.男));  
  17.             peopleList.Add(new People("ZZZZ", 23, Sex.男));  
  18.             peopleList.Add(new People("AAAA", 23, Sex.女));  
  19.             peopleList.Add(new People("BBBB", 18, Sex.女));  
  20.   
  21.             rptPeople.DataSource = peopleList;  
  22.             rptPeople.DataBind();  
  23.         }  
  24.   
  25.         protected void rptPeople_ItemDataBound(object sender, RepeaterItemEventArgs e)  
  26.         {  
  27.             if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)  
  28.             {  
  29.                 People people = e.Item.DataItem as People;  
  30.                 string str = people.Name + "读:";  
  31.   
  32.                 List<string> literaryList = new List<string>();  
  33.                 literaryList.Add(str + "《借我一生》");  
  34.                 literaryList.Add(str + "《追风筝的人》");  
  35.                 literaryList.Add(str + "《山居笔记》");  
  36.                 List<string> scientificList = new List<string>();  
  37.                 scientificList.Add(str + "《时间简史》");  
  38.                 scientificList.Add(str + "《果壳中的宇宙》");  
  39.                 scientificList.Add(str + "《时空的未来》");  
  40.                 List<string> philosophicList = new List<string>();  
  41.                 philosophicList.Add(str + "《周易正义》");  
  42.                 philosophicList.Add(str + "《苏菲的世界》");  
  43.                 philosophicList.Add(str + "《理想国》");  
  44.   
  45.                 Repeater rptLiterary = e.Item.FindControl("rptLiterary"as Repeater;  
  46.                 rptLiterary.DataSource = literaryList;  
  47.                 rptLiterary.DataBind();  
  48.                 Repeater rptScientific = e.Item.FindControl("rptScientific"as Repeater;  
  49.                 rptScientific.DataSource = scientificList;  
  50.                 rptScientific.DataBind();  
  51.                 Repeater rptPhilosophic = e.Item.FindControl("rptPhilosophic"as Repeater;  
  52.                 rptPhilosophic.DataSource = philosophicList;  
  53.                 rptPhilosophic.DataBind();  
  54.             }  
  55.   
  56.         }  
  57.     }  
  58.     public enum Sex  
  59.     {   
  60.         男 = 2,  
  61.         女 = 1,  
  62.     };  
  63.     public class People  
  64.     {  
  65.         public People(string name, uint age, Sex sex)  
  66.         {  
  67.             this.Name = name;  
  68.             this.Age = age;  
  69.             this.Sex = sex;  
  70.         }  
  71.           
  72.          
  73.         public string Name  
  74.         {get;set;}  
  75.         public uint Age  
  76.         { getprivate set; }  
  77.         public Sex Sex  
  78.         { getprivate set; }  
  79.   
  80.     }  
  81. }  
作者: 韩兆新
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
分类:  [06]ASP.NET相关
标签:  ASP.NET

本文转自韩兆新博客博客园博客,原文链接:http://www.cnblogs.com/hanzhaoxin/p/3649707.html,如需转载请自行联系原作者
目录
相关文章
|
7月前
|
人工智能 Java 程序员
一文彻底搞清楚C语言的运算符
本文详细介绍了C语言中的各类运算符,包括算术、关系、逻辑、位运算符、赋值、三目运算符及sizeof,帮助读者深入理解其用法与特性。君志所向,一往无前,希望在成长的路上有你相伴!
504 1
一文彻底搞清楚C语言的运算符
|
7月前
|
人工智能 数据可视化 搜索推荐
云市场伙伴动态 | 分析和商业智能平台领导者Tableau
云市场伙伴动态 | 分析和商业智能平台领导者Tableau
|
8月前
|
人工智能 搜索推荐 Serverless
《AI 剧本生成与动画创作》解决方案测评报告
《AI 剧本生成与动画创作》解决方案测评报告
|
6月前
|
机器学习/深度学习 数据采集 人工智能
DeepSeek R1 最新全面综述:R1 为什么能让 LLM 像人一样思考?
DeepSeek R1 最新全面综述:R1 为什么能让 LLM 像人一样思考?
242 0
|
6月前
|
人工智能 自然语言处理 安全
Axcxept携手阿里云,打造日语“首选”LLM——EZO×Qwen2.5
Axcxept携手阿里云,打造日语“首选”LLM——EZO×Qwen2.5
|
9月前
|
人工智能 数据处理 数据安全/隐私保护
销售易CRM:深耕大中型企业市场的标杆
在中国企业级CRM市场,销售易凭借对中国企业数字化转型需求的深刻理解、技术创新能力、丰富的行业经验和卓越的实施服务能力,赢得了三一、柳工、锦江酒店等大型企业的青睐。其本土化服务和持续创新,使其成为企业数字化转型的可靠伙伴。
|
存储 Android开发 iOS开发
iOS不支持HEIC格式的图片显示和标签函数显示问题及解决方案
iOS不支持HEIC格式的图片显示和标签函数显示问题及解决方案
438 0
|
机器学习/深度学习 数据挖掘 Python
使用pandas_profiling对数据探索性分析
使用pandas_profiling对数据探索性分析
314 0
|
安全 NoSQL Shell
服务器挖矿木马解决办法与预防措施
服务器挖矿木马在17年初慢慢大规模流行,hack利用网络入侵控制了大量的计算机,在移植矿山计划后,利用计算机的CPU和GPU计算力完成了大量的计算,获得了数字加密货币。17年慢慢爆炸后,挖矿木马慢慢变成互联网的主要危害之一。网站服务器如果被挖矿木马团伙攻陷,正常业务服务的性能将遭受严重影响,挖矿木马会被感染,也代表着网站服务器权限被hack攻陷,公司的机密信息可能会泄露,攻击者也可能同时彻底破坏数据。
673 0
服务器挖矿木马解决办法与预防措施
|
弹性计算 负载均衡 监控
阿里aca认证证书含金量怎么样,认证需要具备哪些能力
现如今人们想找到一个好工作是非常重要的,在我们的简历中有一个证书是非常重要的,阿里云aca认证证书就受到很多企业的关注,给大家介绍一下阿里云aca认证证书含金量怎么样吧
1345 0
阿里aca认证证书含金量怎么样,认证需要具备哪些能力