WebForm 控制項(二)

來源:互聯網
上載者:User

標籤:

控制項

Calendar:日曆控制項 但是html代碼了太大不適用

FileUpdate: 檔案上傳

HiddenField:隱藏欄位

Image: 圖片  可以直接給URL 不適用可用html代碼寫

Table:表格  不適用

驗證類登入類內建控制項不要用

 

【Repeater】:

HeaderTemplate - 在載入開始執行一遍

ItemTemplate - 有多少條資料,執行多少遍

FooterTemplate - 在載入最後執行一遍

AlternatingItemTemplate - 交替項目範本

 

<%#Eval("需要的欄位")%>  :動態網頁提供動態資料的符號

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="lianxi.aspx.cs" Inherits="lianxi" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <title></title></head><body>    <form id="form1" runat="server">        <asp:Repeater ID="Repeater1" runat="server">            <HeaderTemplate>                <table style="background-color:navy;text-align:center">                    <tr style="color:white;padding:10px;">                        <td>UserName</td>                        <td>PsssWord</td>                        <td>NickName</td>                        <td>Sex</td>                        <td>Birthday</td>                        <td>Nation</td>                    </tr>             </HeaderTemplate>            <ItemTemplate>                <tr style="background-color:yellow">                    <td><%#Eval("UserName")%></td>                    <td><%#Eval("PassWord")%></td>                     <td><%#Eval("NickName")%></td>                    <td><%#Eval("Sex")%></td>                     <td><%#Eval("birthday")%></td>                    <td><%#Eval("Nation")%></td>                </tr>            </ItemTemplate>            <FooterTemplate>              </table>            </FooterTemplate>                    </asp:Repeater>            </form></body></html>

 

 

光棒效果:

    <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>

 

WebForm 控制項(二)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.