Click here to Skip to main content
Click here to Skip to main content

Tagged as

How to Display Loading Image with AJAX-Auto Complete

, 26 Mar 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
After long time I had a chance to update my Blog. In this post I’m going to show you how to display data fetching progress with AJAX Auto Complete extender. This is very simple. Add ASP Text box to the page (ID=TextBox1) Add AJAX AutoCompleteExtender Insert following javascript code to the web

After long time I had a chance to update my Blog.

In this post I’m going to show you how to display data fetching progress with AJAX Auto Complete extender.

image

This is very simple.

  1. Add ASP Text box to the page (ID=TextBox1)
  2. Add AJAX AutoCompleteExtender
  3. Insert following JavaScript code to the web page
        function ShowImage() {
            document.getElementById('TextBox1')
                 .style.backgroundImage = 'url(images/loader.gif)';
     
            document.getElementById('TextBox1')
                               .style.backgroundRepeat = 'no-repeat';
     
            document.getElementById('TextBox1')
                               .style.backgroundPosition = 'right';
        }
        function HideImage() {
            document.getElementById('TextBox1')
                                 .style.backgroundImage = 'none';
        }
  4. Set OnClientPopulating=ShowImage and OnClientPopulated=HideImage events of AutoCompleteExtender. Complete markup as below.
    <asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server"  
        DelimiterCharacters="" Enabled="True" ServicePath="WebService1.asmx" TargetControlID="TextBox1"
        ServiceMethod="GetCompletionList" MinimumPrefixLength="2"
        OnClientPopulating="ShowImage" OnClientPopulated="HideImage"  />

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Kelum W. Ganegoda
Software Developer (Senior) Brandix Lanka Pvt Ltd.
Sri Lanka Sri Lanka
I’ve started my career in 2001 with Microsoft .net ver 1.0. I’m a MCSD for .net.
 
Currently, I’m working for Sri Lanka’s largest apparel exporter as a Software Engineer. All projects in .net, MS Sql Server, Biztalk Server, WCF and WPF. And also, I’m developing components to the ERP. In addition to that, I’ve involved to create architecture of ERP integration.
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 27 Mar 2014
Article Copyright 2014 by Kelum W. Ganegoda
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid