as.net寻求帮助的入门级 [英] as.net for help beginers level

查看:61
本文介绍了as.net寻求帮助的入门级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的源文件...

this is my source file...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Repeater ID="rptrTable" runat="server"

            onitemcommand="rptrTable_ItemCommand" >

        <HeaderTemplate>
        <table border="2">
                        <tr bgcolor="#00ff66">
        <table border=3>
        <tr>
        <th>Agent ID</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>City</th>
        <th>SSN</th>
        </tr>

        </HeaderTemplate>
        <ItemTemplate>
        <tr>

        <td>
        <%# DataBinder.Eval(Container.DataItem,"AgentID") %>
        </td>
        <td>
        <%# DataBinder.Eval(Container.DataItem,"FirstName") %>
        </td>
        <td>
        <%# DataBinder.Eval(Container.DataItem,"LastName") %>
        </td>
        <td>
        <%# DataBinder.Eval(Container.DataItem,"City") %>
        </td>
        <td>
        <%# DataBinder.Eval(Container.DataItem,"SSN") %>
        </td>

        <td>
            <asp:Button ID="btnShow" runat="server" Text="Show" CommandName="ShowButt" CommandArgument='<%# Eval("FirstName") %>' />
        </td>
        <td>
            <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="EditButt" />
        </td>

        </tr>
        </ItemTemplate>

        </asp:Repeater>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>



但是通过使用表中的AlternateTemplate记录,则需要以其他颜色显示..但是,在我使用上述源文件中的此替代模板获取其他颜色的记录的过程中,请使用.plz help ,,,,



but by using AlternateTemplate records in table need to be display in alternate colours .. but where i use this alternate templete in above source file to get the records in alternate colour plz help ,,,,

推荐答案

选中此
Repeater.AlternatingItemTemplate属性 [
Check this
Repeater.AlternatingItemTemplate Property[^]


try;
http://blog .net-tutorials.com/2009/04/02/how-to-alternate-row-color-with-the-aspnet-repeater-control/ [ http://coilmedia.com/post/2010 /how-style-alternating-rows-asp-net-repeater-datalist-using-css/ [
try ;
http://blog.net-tutorials.com/2009/04/02/how-to-alternate-row-color-with-the-aspnet-repeater-control/[^]

http://coilmedia.com/post/2010/how-style-alternating-rows-asp-net-repeater-datalist-using-css/[^]


这篇关于as.net寻求帮助的入门级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆