Ajax Control Toolkit 34个服务器端控件(8)

来源:互联网 发布:haproxy windows版 编辑:程序博客网 时间:2024/04/30 06:38

33. ListSearchExtender

【功能概述】

支持对ListBox or DropDownList的扩展通过用户键入的字符对列表中的数据进行过滤,在WinForm中做的更好一些。顺便说一下在winform里面以前在VS6.0的时代我们是怎么实现这个功能的呢?还记得吗?Sendmessage函数向ListBox或者Combox发送Find_Text消息,很怀旧了

【细节】

1.      PromptText属性的作用有两个,一是显示提示信息,省的用户不知道还有这个功能。再者就是即时的显示用户输入的数据。

2.      SafariDropDownList扩展失效;Opera中后退键会被认为要后退一页!!!

3.      显然这个控件如果还有什么要说的就是可以设置Prompt信息的外观(样式+位置)

看代码:

<ajaxToolkit:ListSearchExtender id="LSE" runat="server"
    TargetControlID="ListBox1"
    PromptText="Type to search"
    PromptCssClass="ListSearchExtenderPrompt"
    PromptPosition="Top" /> 

34. Slider Show

【功能概述】

Web2.0时代,博客是一个标志,在博客上挂着的图片幻灯片同样成为一个标记。

【细节】

1.首先它是对图片控件的扩展,之后的问题就是:我们要把图片取出来;下面是方法:SlideShowServiceMethod - The webservice method that will be called to supply images. The signature of the method must match this:

·                             [System.Web.Services.WebMethod]

·                             [System.Web.Script.Services.ScriptMethod]

    public AjaxControlToolkit.Slide[] GetSlides() { ... }

1.      还要设置的就是Web Service 去图片的路径SlideShowServicePath

2.      NextButtonID PlayButtonID PreviousButtonID PlayButtonText StopButtonText

PlayInterval ImageDescriptionLabelID Loop AutoPlay头脑中想象着任何一个播放器,这些属性就很容易理解了。

<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" /> 
原创粉丝点击