Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Loading image in textbox(auto complete extender)

Loading image in textbox(auto complete extender)

Scheduled Pinned Locked Moved ASP.NET
databasesysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    md_azy
    wrote on last edited by
    #1

    Hi, I am implementing auto complete extender in my project. I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user. <asp:TextBox id="TextBox2" Width="216px" runat="server" Text='<%# Bind("c_name") %>' autocomplete="off" ></asp:TextBox> <cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" ServiceMethod="fetch" TargetControlID ="TextBox2" ServicePath="autocom.asmx" CompletionSetCount ="12" EnableCaching ="true" MinimumPrefixLength ="2"> </cc1:AutoCompleteExtender>

    S A B 3 Replies Last reply
    0
    • M md_azy

      Hi, I am implementing auto complete extender in my project. I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user. <asp:TextBox id="TextBox2" Width="216px" runat="server" Text='<%# Bind("c_name") %>' autocomplete="off" ></asp:TextBox> <cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" ServiceMethod="fetch" TargetControlID ="TextBox2" ServicePath="autocom.asmx" CompletionSetCount ="12" EnableCaching ="true" MinimumPrefixLength ="2"> </cc1:AutoCompleteExtender>

      S Offline
      S Offline
      Spunky Coder
      wrote on last edited by
      #2

      You can use AJAX UpdateProgress control to get that functionality. See here UpdateProgress control[^]

      "Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)

      1 Reply Last reply
      0
      • M md_azy

        Hi, I am implementing auto complete extender in my project. I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user. <asp:TextBox id="TextBox2" Width="216px" runat="server" Text='<%# Bind("c_name") %>' autocomplete="off" ></asp:TextBox> <cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" ServiceMethod="fetch" TargetControlID ="TextBox2" ServicePath="autocom.asmx" CompletionSetCount ="12" EnableCaching ="true" MinimumPrefixLength ="2"> </cc1:AutoCompleteExtender>

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        md_azy wrote:

        I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user

        use AJAX UpdateProgress Control.

        cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net

        1 Reply Last reply
        0
        • M md_azy

          Hi, I am implementing auto complete extender in my project. I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user. <asp:TextBox id="TextBox2" Width="216px" runat="server" Text='<%# Bind("c_name") %>' autocomplete="off" ></asp:TextBox> <cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" ServiceMethod="fetch" TargetControlID ="TextBox2" ServicePath="autocom.asmx" CompletionSetCount ="12" EnableCaching ="true" MinimumPrefixLength ="2"> </cc1:AutoCompleteExtender>

          B Offline
          B Offline
          Bangla Gopal Surya Prakash
          wrote on last edited by
          #4

          1st Approach <script type="text/javascript"> function ShowImage() { document.getElementById('txtAutoComplete') .style.backgroundImage = 'url(images/loader.gif)'; document.getElementById('txtAutoComplete') .style.backgroundRepeat= 'no-repeat'; document.getElementById('txtAutoComplete') .style.backgroundPosition = 'right'; } function HideImage() { document.getElementById('txtAutoComplete') .style.backgroundImage = 'none'; } </script> Now write this code in Page_Load event of aspx page protected void Page_Load(object sender, EventArgs e) { this.txtAutoComplete.Attributes.Add ("onkeypress", "ShowImage()"); this.txtAutoComplete.Attributes.Add ("onblur", "HideImage()"); } +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2nd approach This approach works if you are using newer versions of AjaxControlToolkit.dll (Version 1.0.20229.20821 or later) For this write the above mentioned javascript in head section of html markup of page. Now in source of autocomplete extender add OnClientPopulating="ShowImage" and OnClientPopulated="HideImage" <ajaxToolkit:AutoCompleteExtender runat="server" ID="AutoComplete1" BehaviorID="autoComplete" TargetControlID="txtAutoComplete" ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" CompletionInterval="10" EnableCaching="true" CompletionSetCount="12" CompletionListCssClass= "autocomplete_completionListElement" CompletionListItemCssClass= "autocomplete_listItem" CompletionListHighlightedItemCssClass= "autocomplete_highlightedListItem" onclientpopulating="ShowImage" onclientpopulated="HideImage"> </ajaxToolkit:AutoCompleteExtender> <script type="text/javascript"> function ShowImage() { document.getElementById('txtAutoComplete') .style.backgroundImage = 'url(images/loader.gif)'; document.getElementById('txtAutoComplete') .style.backgroundRepeat= 'no-repeat'; document.getElementById('txtAutoComplete') .style.backgroun

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups