AJAX Toolkits -- SlideShow

在AJAX Toolkits中有个SlideShow扩展控件,其主要是对于Image控件的。

该功能能实现循环暂时大批图片,像放幻灯一样。其属性有:

  • SlideShowServicePath - Path to the webservice that the extender will pull the images from. (我认为这个可以不用)
  • SlideShowServiceMethod - 处理的方法名。用户在将扩展控件添加到Image控件之后,可以用同样的操作方法,在后台添加一个方法,其函数默认为GetSlide
  • ContextKey - User/page specific context provided to an optional overload of the web method described by ServiceMethod/ServicePath. If the context key is used, it should have the same signature with an additional parameter named contextKey of type string:
  •       [System.Web.Services.WebMethod]
          [System.Web.Script.Services.ScriptMethod]
             public AjaxControlToolkit.Slide[] GetSlides(string contextKey)

    Note that you can replace "GetSlides" with a name of your choice, but the return type and parameter name and type must exactly match, including case.

  • UseContextKey - Whether or not the ContextKey property should be used. This will be automatically enabled if the ContextKey property is ever set (on either the client or the server). If the context key is used, it should have the same signature with an additional parameter named contextKey of type string (as described above). 这里我是设置为True
  • NextButtonID - ID of the button that will allow you to see the next picture. (由于我不需要则没有设置)
  • PlayButtonID - ID of the button that will allow you to play/stop the slideshow. (由于我不需要则没有设置)
  • PreviousButtonID - ID of the button that will allow you to see the previous picture. (由于我不需要则没有设置)
  • PlayButtonText - The text to be shown in the play button to play the slideshow. (由于我不需要则没有设置)
  • StopButtonText - The text to be shown in the play button to stop the slideshow. (由于我不需要则没有设置)
  • PlayInterval - 每个画面的间隔时间,毫秒级.
  • ImageTitleLabelID - 图片名称对应的Label编号,可以不用.
  • ImageDescriptionLabelID - 图片描述对应的Label编号,可以不用.
  • Loop - 布尔型,是否循环播放.
  • AutoPlay - 布尔型,是否自动播放.
  •  

    示例代码:

    这里比较特殊的是,其还包含后台代码,后台主要是返回需要播放的图片集合,如下:

    Code

     

    其中有三个变量,第一个是图片的路径,第二个是图片的标题(对应于标题Label),第三个是图片的描述(对应于描述Label)

    而前台代码是:

    Code

     

    特别主要,后台传入的图片路径和前台的URL是不完全相同的

    posted on 2009-01-06 10:26  Mike Luo  阅读(270)  评论(0编辑  收藏  举报

    导航