精华内容
下载资源
问答
  • Repeater

    2016-09-22 17:21:00
    Repeater: HeaderTemplate - 在加载开始执行一遍 头部模版 ItemTemplate - 有多少条数据,执行多少遍 向模版 FooterTemplate - 在加载最后执行一遍 脚模版 AlternatingItemTemplate - 交替项模板<asp:...

    Repeater:

    HeaderTemplate - 在加载开始执行一遍 头部模版

    ItemTemplate - 有多少条数据,执行多少遍 向模版

    FooterTemplate - 在加载最后执行一遍 脚模版

    AlternatingItemTemplate - 交替项模板
    <asp:Repeater ID="Repeater1" runat="server">
    <HeaderTemplate>
    <table style="background-color: navy; text-align: center;">
    <tr style="color: white; padding: 10px;">
    <td>区域编号</td>
    <td>区域名称</td>
    <td>区域父级编号</td>
    </tr>
    </HeaderTemplate>
    <ItemTemplate>
    <tr style="background-color: #e0e0e0;">
    <td><%#Eval("AreaCode") %></td>
    <td><%#Eval("AreaName") %></td>
    <td><%#Eval("ParentAreaCode") %></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>

    库存预警:
    通过某个属性值判断后,将某条数据的样式进行更改

    属性扩展的方式,写一个返回string类型的属性,返回的是CSS样式表样式
    public string Red
    {
    get
    {
    string end = "";
    if (Convert.ToInt32(Age) >= 16)
    {
    end = "background-color:red;";
    }
    return end;
    }
    }

    获取:
    <ItemTemplate>
    <tr class="tr_Item" style="<%#Eval("Red")%>">
    <td><%#Eval("UserName") %></td>
    <td><%#Eval("PassWord") %></td>
    <td><%#Eval("NickName") %></td>
    <td><%#Eval("SexStr") %></td>
    <td><%#Eval("BirthdayStr") %></td>
    <td><%#Eval("Age") %></td>
    <td><%#Eval("NationName") %></td>
    </tr>
    </ItemTemplate>

    为了让大家知道,属性值不一定非得是展示用

    方法的方式:


    光棒效果:
    <script type="text/javascript">
    window.onload = function () {
    var items = document.getElementsByClassName("tr_Item");
    var oldColor = "";
    for (var i = 0; i < items.length; i++) {
    items[i].onmouseover = function () {
    oldColor = this.style.backgroundColor;
    this.style.backgroundColor = "yellow";
    };
    items[i].onmouseout = function () {
    this.style.backgroundColor = oldColor;
    };

    }


    };
    </script>
    布局
    去除3毫米边框:
    padding 0px;
    margin 0px;

    JS
    <script type="text/javascript">
    var items = document.getElementsByClassName("item");

    var hei = items[0].offsetHeight;

    document.getElementById("main").style.height = (hei + 10) * Math.ceil(items.length / 4) + 'px';

     


    </script>
    获取每一个的高度
    展示信息:
    <div id="main">

    <asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
    <div class="item">
    <%#Eval("UserName") %><br />
    <%#Eval("PassWord") %><br />
    <%#Eval("NickName") %>
    </div>
    </ItemTemplate>
    </asp:Repeater>


    </div>

    Repeater可以套Repeater,Repeater嵌套。
    -----------------------------------------------
    非表格的信息展示:
    1、纯HTML+css+js制作

    2、添加Repeater控件,将数据绑定展示

    转载于:https://www.cnblogs.com/weiwenxin01/p/5897200.html

    展开全文
  • repeater

    2009-11-23 17:52:00
    Repeater嵌套绑定Repeater Repeater嵌套Repeater的结构:一般写过的都能看懂吧 cs代码: CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->private 
     
    

    Repeater嵌套绑定Repeater

    Repeater嵌套Repeater的结构:一般写过的都能看懂吧

     cs代码: 

     


    private   void  RpTypeBind()
            {
    // GetQuestionTypeAndCount() 返回一个datatable
                 this .rptypelist.DataSource  =  LiftQuestionCtr.GetQuestionTypeAndCount();                   
                
    this .rptypelist.DataBind();
            }
                   
    protected   void  rptypelist_ItemDataBound( object  sender, RepeaterItemEventArgs e)
            {

    // 判断里层repeater处于外层repeater的哪个位置( AlternatingItemTemplate,FooterTemplate,

    // HeaderTemplate,,ItemTemplate,SeparatorTemplate)
                 if  (e.Item.ItemType  ==  ListItemType.Item  ||  e.Item.ItemType  ==  ListItemType.AlternatingItem)
                {
                    Repeater rep 
    =  e.Item.FindControl( " rpquestionlist " as  Repeater; // 找到里层的repeater对象
                    DataRowView rowv  =  (DataRowView)e.Item.DataItem; // 找到分类Repeater关联的数据项 
                     int  typeid  =  Convert.ToInt32(rowv[ " qtid " ]);  // 获取填充子类的id 
                    rep.DataSource  =  LiftQuestionCtr.GetSomeQuestionsByTypeid(typeid,  2 );
                    rep.DataBind();
                }
            }

     

    aspx:


    < table border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  style = " margin-bottom: 5px "  width = " 100% " >
        
    < asp:Repeater runat = " server "  ID = " rptypelist "  OnItemDataBound = " rptypelist_ItemDataBound " >
            
    < ItemTemplate >
                
    < tr >
                    
    < td  class = " fb " >
                        
    & nbsp; & nbsp; < a href = " Lists.aspx?Qtid=<%#Eval( " qtid " ) %> " ><% #Eval( " qtypename " %></ a >   < span id = " askCount_15 "
                            
    class = " date2 " > [ <% #Eval( " typecount " ) %> ] </ span >
                    
    </ td >
                
    </ tr >
                
    < tr >
                    
    < td >
                        
    < div id = " askTop2_15 "   class = " ask_list " >
                            
    < asp:Repeater runat = " server "  ID = " rpquestionlist " >
                                
    < ItemTemplate >
                                    
    < a href = " Question.aspx?qid=<%#Eval( " liftquestionid " )%> " >
                                        
    <% #Eval( " questiontitle " ) %></ a >< br  />
                                
    </ ItemTemplate >
                            
    </ asp:Repeater >
                        
    </ div >
                    
    </ td >
                
    </ tr >
            
    </ ItemTemplate >
        
    </ asp:Repeater >
    </ table >

    展开全文
  • Repeater

    2007-08-16 16:39:00
    <asp:Repeater runat= "server"  ID= "menu"  DataSourceID= "SiteMapDataSource1" >  <ItemTemplate>  <li>   runat= "server"    NavigateUrl= " Eval(" Url ") %>" >   ...
    1. <asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1">   
    2.      <ItemTemplate>   
    3.          <li>   
    4.              <asp:HyperLink runat="server"  
    5.              NavigateUrl="<%# Eval("Url") %>">   
    6.              <%# Eval("Title") %></asp:HyperLink>   
    7.     
    8.             <asp:Repeater runat="server"  
    9.             DataSource="<%# ((SiteMapNode)  
    10.             Container.DataItem).ChildNodes %>">   
    11.                 <HeaderTemplate>   
    12.                     <ul>   
    13.                 </HeaderTemplate>   
    14.   
    15.                 <ItemTemplate>   
    16.                     <li>   
    17.                         <asp:HyperLink runat="server"  
    18.                          NavigateUrl="<%# Eval("Url") %>">   
    19.                          <%# Eval("Title") %></asp:HyperLink>   
    20.                     </li>   
    21.                 </ItemTemplate>   
    22.   
    23.                 <FooterTemplate>   
    24.                     </ul>   
    25.                 </FooterTemplate>   
    26.             </asp:Repeater>   
    27.         </li>   
    28.      </ItemTemplate>   
    29.  </asp:Repeater>  
     
    展开全文
  • Repeater嵌套绑定Repeater

    2019-09-30 12:23:46
    Repeater嵌套绑定Repeater Repeater嵌套Repeater的结构:一般写过的都能看懂吧 cs代码 Repeater嵌套绑定RepeaterRepeater嵌套绑定RepeaterCodeprivate void RpTypeBind() {//GetQuestionTypeAndCount() ...

    Repeater嵌套绑定Repeater

     

    Repeater嵌套Repeater的结构:一般写过的都能看懂吧

    cs代码

    Repeater嵌套绑定Repeater
    Repeater嵌套绑定Repeater
    Code
    private void RpTypeBind()
    {//GetQuestionTypeAndCount() 返回一个datatable
    this.rptypelist.DataSource = LiftQuestionCtr.GetQuestionTypeAndCount();
    this.rptypelist.DataBind();
    }
    protected void rptypelist_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {

    //判断里层repeater处于外层repeater的哪个位置( AlternatingItemTemplate,FooterTemplate,

    //HeaderTemplate,,ItemTemplate,SeparatorTemplate)
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
    Repeater rep = e.Item.FindControl("rpquestionlist") as Repeater;//找到里层的repeater对象
    DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项
    int typeid = Convert.ToInt32(rowv["qtid"]); //获取填充子类的id
    rep.DataSource = LiftQuestionCtr.GetSomeQuestionsByTypeid(typeid, 2);
    rep.DataBind();
    }
    }

    ASPX

    <table border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 5px" width="100%">
    <asp:Repeater runat="server" ID="rptypelist" OnItemDataBound="rptypelist_ItemDataBound">
    <ItemTemplate>
    <tr>
    <td class="fb">
    &nbsp;&nbsp;<a href="Lists.aspx?Qtid=<%#Eval("qtid") %>"><%#Eval("qtypename") %></a> <span id="askCount_15"
    class="date2">[<%#Eval("typecount")%>]</span>
    </td>
    </tr>
    <tr>
    <td>
    <div id="askTop2_15" class="ask_list">
    <asp:Repeater runat="server" ID="rpquestionlist">
    <ItemTemplate>
    <a href="Question.aspx?qid=<%#Eval("liftquestionid")%>">
    <%#Eval("questiontitle")%></a><br />
    </ItemTemplate>
    </asp:Repeater>
    </div>
    </td>
    </tr>
    </ItemTemplate>
    </asp:Repeater>
    </table>

    转自http://www.cnblogs.com/zmxmiss/archive/2009/02/26/1398635.html

    转载于:https://www.cnblogs.com/luqingsong/archive/2011/12/27/2304049.html

    展开全文
  • RepeaterRepeater

    2019-04-02 10:18:27
    前台 <table> <asp:Repeater ID="rep" runat="server" OnItemDataBound="rep_ItemDataBound"> <ItemTemplate> <tr> <td>&l...
  • 在某些特殊情况下是需要在Repeater中嵌套使用Repeater的,下面有个不错的示例,感兴趣的朋友可以参考下
  • repeater嵌套repeater

    2017-05-30 22:24:00
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ...
  • Repeater表头自定义排序; Repeater嵌套Repeater
  • Repeater是无衬线几何字体。 设计正在进行中。 它是潜在体重家族中的一个体重。 执照 Repeater是根据SIL Open Font License发布的。 可在上的常见问题解答中获得此许可证。 仓库布局 该字体存储库基于统一字体存储库...
  • Repeater嵌套

    2017-10-25 16:27:27
    repeater嵌套经常会在一些特殊效果显示下会用到,新手朋友们可以详细看下本文,希望对你有所帮助,代码很整洁同时附有源码
  • ve discovered a problem with nested repeater field data not being deleted when a nested repeater row is deleted. <p>To replicate the issue, create a repeater field that has a maybe couple text fields ...
  • Repeater嵌套Repeater

    2012-06-08 08:56:00
    第一步:在前台建立两个Repeater,一个嵌套在另一个Repeater里面,下面代码没什么好说的。 <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound"> <ItemTemplate...
  • Repeater example

    2020-12-08 23:27:59
    Each dish shoudl have a repeater which represents the cooking steps. <p>How do you setup the database so that iot stores the repeater items, please? ~ Marc</p><p>该提问来源于开源项目:rainlab/...
  • bindonce repeater

    2021-01-07 11:03:56
    <p>I was wondering if a bindonce type repeater would make sense. That repeater would wait for the collection to be there, but wouldn't shallow-watch the collection. <p>Not sure it makes sense. ...
  • Repeater示例

    热门讨论 2014-03-23 16:26:12
    Repeater基本使用方法示例,包括编辑、删除、更新、分页功能,其中编辑和删除页面名称为EditPage。
  • 主要介绍了asp.net在Repeater嵌套的Repeater中使用复选框,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 10,605
精华内容 4,242
关键字:

repeater