学习笔记:SildeShow 相册无刷新翻页或幻灯片方式浏览..
基本实现
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServiceMethod="GetSlides"
AutoPlay="true"
ImageDescriptionLabelID="imageLabel1"
NextButtonID="nextButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="prevButton"
PlayButtonID="playButton"
Loop="true" />
在WebService里必须在属性里添加
[System.Web.Script.Services.ScriptMethod]
WebService方法返回AjaxControlToolkit.Slide[]
public AjaxControlToolkit.Slide[] Silddeshow()
{
//Slide构造函数参数:new AjaxControlTookKit.Slide(string path,string name,string description) path:图片路径,name:图片名(自定义),description:图片的描述信息;在描述标签里文本显示格式为: name:description
AjaxControlToolkit.Slide s1 = new AjaxControlToolkit.Slide(@"images/Blue hills.jpg", "Blue hill", "Blue hill");
AjaxControlToolkit.Slide s2 = new AjaxControlToolkit.Slide(@"images/Sunset.jpg", "Sunset", "Sunset");
AjaxControlToolkit.Slide s3 = new AjaxControlToolkit.Slide(@"images/Water lilies.jpg", "Water lilies", "Water lilies");
AjaxControlToolkit.Slide s4 = new AjaxControlToolkit.Slide(@"images/Winter.jpg", "Winter", "Winter");
AjaxControlToolkit.Slide[] s = new AjaxControlToolkit.Slide[] { s1,s2,s3,s4};
return s;
}
属性
|
说明
|
SlideShowServicePath | 请求获得图片的WebService路径 |
SlideShowServiceMethod | 请求获得图片的WebSerive里的方法... |
NextButtonID | 翻页下一张的按钮ID |
PlayButtonID | 幻灯片控制暂停/播放的按钮ID |
PreviousButtonID | 翻页上一张的按钮ID |
PlayButtonText | 幻灯片暂停播放时控制按钮的文本显示 |
StopButtonText | 幻灯片正在播放时控制按钮的文本显示 |
PlayInterval | 幻灯片播放间隔的毫秒数 |
ImageDescriptionLabelID | 描述当前图片的文本标签的ID |
Loop | 设置是否循环播放(幻灯片模式) |
AutoPlay | 设置是否允许幻灯片模式播放 |