功能:
能够与Image控件创建起关联,轻易实现出一个具备导航与自动播放功能的页面相册。
属性:
TargetControlID : 要与"相册播放"扩展器创建起关联性,以便通过它来展示相片Image控件ID。
SlideShowServicePath :提供相片的web服务的位置路径与文件名称。如果使用的是页面方法,则不需要。
AutoPlay :是否在页面加载完成之后,自动播放相片。
ImageDescriptionLabelID :用来显示目前所显示之相片说明的Label控件ID。
NextButtonID :用来播放下一张相处的按钮控件ID。
PlayButtonText :播放按钮上的文字。
StopButtonText :停止播放上的文字。
PreviousButtonID :用来播放上一张相片的按钮控件ID。
PlayButtonID :开始与停止播放相片按钮的控件ID。
Loop :是否允许循环播放。
PlayInterval :自动播放时,每张相片的间隔时间(单位:毫秒)默认是3000。
代码实例:
    
 <html xmlns="http://www.w3.org/1999/xhtml" >
<html xmlns="http://www.w3.org/1999/xhtml" >
 <head id="Head1" runat="server">
<head id="Head1" runat="server">
 <title>SlideShow控件</title>
    <title>SlideShow控件</title>
 <link href="style.css" type="text/css" rel="Stylesheet" />
    <link href="style.css" type="text/css" rel="Stylesheet" />
 </head>
</head>
 <body>
<body>
 <form id="form1" runat="server">
    <form id="form1" runat="server">
 <div style="text-align: center">
        <div style="text-align: center">
 <asp:ScriptManager ID="ScriptManager1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>
            </asp:ScriptManager>
 <asp:Image ID="Image1" runat="server" style="border: 5px outset Navy; width: auto;"
            <asp:Image ID="Image1" runat="server" style="border: 5px outset Navy; width: auto;"
 ImageUrl="~/Images/Blue Hills.JPG" AlternateText="Blue Hills" />
                ImageUrl="~/Images/Blue Hills.JPG" AlternateText="Blue Hills" />
 <p />
            <p />
 <asp:Label runat="Server" ID="imageLabel1" Font-Bold="True" ForeColor="Navy" />
            <asp:Label runat="Server" ID="imageLabel1" Font-Bold="True" ForeColor="Navy" />
 <br />
            <br />
 <asp:ImageButton ID="prevButton" runat="server"
            <asp:ImageButton ID="prevButton" runat="server"
 ImageUrl="~/Images/Prev.jpg" />
                ImageUrl="~/Images/Prev.jpg" />
 <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
            <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
 <asp:ImageButton ID="nextButton" runat="server"
            <asp:ImageButton ID="nextButton" runat="server"
 ImageUrl="~/Images/Next.jpg" />
                ImageUrl="~/Images/Next.jpg" />
 <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
            <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
 TargetControlID="Image1" SlideShowServiceMethod="GetSlides"
                TargetControlID="Image1" SlideShowServiceMethod="GetSlides"
 AutoPlay="true" ImageDescriptionLabelID="imageLabel1"
                AutoPlay="true" ImageDescriptionLabelID="imageLabel1"
 NextButtonID="nextButton" PlayButtonText="Play"
                NextButtonID="nextButton" PlayButtonText="Play"
 StopButtonText="Stop" PreviousButtonID="prevButton"
                StopButtonText="Stop" PreviousButtonID="prevButton"
 PlayButtonID="playButton" Loop="true" PlayInterval="5000" />
                PlayButtonID="playButton" Loop="true" PlayInterval="5000" />
 </div>
        </div>
 </form>
    </form>
 </body>
</body>
 </html>
</html>
web服务方法或布面方法必须符合下列的签名格式:
 [System.Web.Services.WebMethod]
 [System.Web.Services.WebMethod]
 [System.Web.Script.Services.ScriptMethod]
    [System.Web.Script.Services.ScriptMethod]
 public AjaxControlToolkit.Slide[] GetSlides(string contextKey) {
    public AjaxControlToolkit.Slide[] GetSlides(string contextKey) { 
 }
 }
运行结果:
     
 
能够与Image控件创建起关联,轻易实现出一个具备导航与自动播放功能的页面相册。
属性:
TargetControlID : 要与"相册播放"扩展器创建起关联性,以便通过它来展示相片Image控件ID。
SlideShowServicePath :提供相片的web服务的位置路径与文件名称。如果使用的是页面方法,则不需要。
AutoPlay :是否在页面加载完成之后,自动播放相片。
ImageDescriptionLabelID :用来显示目前所显示之相片说明的Label控件ID。
NextButtonID :用来播放下一张相处的按钮控件ID。
PlayButtonText :播放按钮上的文字。
StopButtonText :停止播放上的文字。
PreviousButtonID :用来播放上一张相片的按钮控件ID。
PlayButtonID :开始与停止播放相片按钮的控件ID。
Loop :是否允许循环播放。
PlayInterval :自动播放时,每张相片的间隔时间(单位:毫秒)默认是3000。
代码实例:
 <html xmlns="http://www.w3.org/1999/xhtml" >
<html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server">
<head id="Head1" runat="server"> <title>SlideShow控件</title>
    <title>SlideShow控件</title> <link href="style.css" type="text/css" rel="Stylesheet" />
    <link href="style.css" type="text/css" rel="Stylesheet" /> </head>
</head> <body>
<body> <form id="form1" runat="server">
    <form id="form1" runat="server"> <div style="text-align: center">
        <div style="text-align: center"> <asp:ScriptManager ID="ScriptManager1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
            </asp:ScriptManager> <asp:Image ID="Image1" runat="server" style="border: 5px outset Navy; width: auto;"
            <asp:Image ID="Image1" runat="server" style="border: 5px outset Navy; width: auto;" ImageUrl="~/Images/Blue Hills.JPG" AlternateText="Blue Hills" />
                ImageUrl="~/Images/Blue Hills.JPG" AlternateText="Blue Hills" /> <p />
            <p /> <asp:Label runat="Server" ID="imageLabel1" Font-Bold="True" ForeColor="Navy" />
            <asp:Label runat="Server" ID="imageLabel1" Font-Bold="True" ForeColor="Navy" /> <br />
            <br /> <asp:ImageButton ID="prevButton" runat="server"
            <asp:ImageButton ID="prevButton" runat="server" ImageUrl="~/Images/Prev.jpg" />
                ImageUrl="~/Images/Prev.jpg" /> <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
            <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" /> <asp:ImageButton ID="nextButton" runat="server"
            <asp:ImageButton ID="nextButton" runat="server" ImageUrl="~/Images/Next.jpg" />
                ImageUrl="~/Images/Next.jpg" /> <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
            <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server" TargetControlID="Image1" SlideShowServiceMethod="GetSlides"
                TargetControlID="Image1" SlideShowServiceMethod="GetSlides" AutoPlay="true" ImageDescriptionLabelID="imageLabel1"
                AutoPlay="true" ImageDescriptionLabelID="imageLabel1" NextButtonID="nextButton" PlayButtonText="Play"
                NextButtonID="nextButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton"
                StopButtonText="Stop" PreviousButtonID="prevButton" PlayButtonID="playButton" Loop="true" PlayInterval="5000" />
                PlayButtonID="playButton" Loop="true" PlayInterval="5000" /> </div>
        </div> </form>
    </form> </body>
</body> </html>
</html>web服务方法或布面方法必须符合下列的签名格式:
 [System.Web.Services.WebMethod]
 [System.Web.Services.WebMethod] [System.Web.Script.Services.ScriptMethod]
    [System.Web.Script.Services.ScriptMethod] public AjaxControlToolkit.Slide[] GetSlides(string contextKey) {
    public AjaxControlToolkit.Slide[] GetSlides(string contextKey) {  }
 }运行结果:
 
                    
                     
                    
                 
                    
                 
                
 
 
         
    
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号