default2.aspx

来自「microsoft公司在进行ASP.NET 2.0培训课时课堂操作演示代码。」· ASPX 代码 · 共 56 行

ASPX
56
字号
<%@ 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 runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <marquee direction=down scrollamount=3 onmouseout="this.start();" onmouseover="this.stop();">
   
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
        <HeaderTemplate>
         <table border="0" cellpadding="0" cellspacing="0">
        </HeaderTemplate>
        <ItemTemplate>
         <tr>
                <td style="width: 300px">
                <a href='<%# "NewsDetail.aspx?NID="+Eval("NewsId") %>'><%# Eval("Title") %></a>
                </td>
                <td style="width: 200px">
                <%# Eval("Pubdate") %>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
        <tr>
                <td style="width: 300px;color:#00ff00">
                <a href='<%# "NewsDetail.aspx?NID="+Eval("NewsId") %>' style="color:Green"><%# Eval("Title") %></a>
                </td>
                <td style="width: 200px">
                <%# Eval("Pubdate") %>
                </td>
            </tr>
         
        </AlternatingItemTemplate>
        <FooterTemplate>
           </table>
        </FooterTemplate>
        </asp:Repeater>
        </marquee>
        
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NewsDBConnectionString %>"
            SelectCommand="SELECT * FROM [NewsInfo]"></asp:SqlDataSource>
       
           
     
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?