Terry's blog

Focus on bigdata and cloud.

博客园 首页 新随笔 联系 订阅 管理
功能:
    能够与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" >
<head id="Head1" runat="server">
    
<title>SlideShow控件</title>
    
<link href="style.css" type="text/css" rel="Stylesheet" />
</head>
<body>
    
<form id="form1" runat="server">
        
<div style="text-align: center">
            
<asp:ScriptManager ID="ScriptManager1" runat="server">
            
</asp:ScriptManager>
            
<asp:Image ID="Image1" runat="server" style="border: 5px outset Navy; width: auto;"
                ImageUrl
="~/Images/Blue Hills.JPG" AlternateText="Blue Hills" />
            
</>
            
<asp:Label runat="Server" ID="imageLabel1" Font-Bold="True" ForeColor="Navy" />
            
<br />
            
<asp:ImageButton ID="prevButton" runat="server"
                ImageUrl
="~/Images/Prev.jpg" />
            
<asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
            
<asp:ImageButton ID="nextButton" runat="server"
                ImageUrl
="~/Images/Next.jpg" />
            
<ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
                TargetControlID
="Image1" SlideShowServiceMethod="GetSlides"
                AutoPlay
="true" ImageDescriptionLabelID="imageLabel1"
                NextButtonID
="nextButton" PlayButtonText="Play"
                StopButtonText
="Stop" PreviousButtonID="prevButton"
                PlayButtonID
="playButton" Loop="true" PlayInterval="5000" />
        
</div>
    
</form>
</body>
</html>

web服务方法或布面方法必须符合下列的签名格式:
 [System.Web.Services.WebMethod]
    [System.Web.Script.Services.ScriptMethod]
    
public AjaxControlToolkit.Slide[] GetSlides(string contextKey) 
 }

运行结果:
    
posted on 2007-11-13 16:29  王晓成  阅读(846)  评论(0编辑  收藏  举报