close

利用Ajax的ScriptManager、UpdatePanel、Timer來達到不用按下重整即可重複輪播

<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">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:Timer ID="Timer1" Interval="3000" runat="server"></asp:Timer>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                </Triggers>
                <ContentTemplate>
                    <asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/MyAdRotator.xml" Height="600px" Width="600px" />
                </ContentTemplate>
            </asp:UpdatePanel>            

        </div>
    </form>
</body>
</html>

arrow
arrow
    全站熱搜

    KAi 發表在 痞客邦 留言(0) 人氣()