home  |  about  |  contact us
Overview  |  XWebSiteTemplate  |  XBalloon  |  AutoSuggestMenu  |  AutoSuggestBox
How to add AutoSuggestMenu to your ASP.NET project
back to documentation <<

Download and add required files
  1. Download the "AutoSuggestMenu" package from here
  2. Unzip the file into a directory on your system
  3. Open new or already existing web application in Visual Studio .NET
  4. Add reference to "AutoSuggestMenu.dll"
    1. Right click on the project in Solution Explorer and select "Add Reference"
    2. Click on 'Browse' button in the top right corner
    3. Go to directory where you unzipped the files, select "AutoSuggestMenu.dll" and click "Open"
    4. AutoSuggestMenu should now appear in the references folder of your project
  5. Copy AutoSuggestMenu resource files into your project
    1. Run 'Windows Explorer' and open the directory where you unzipped the files in step 2
    2. Right-click on sub-directory 'asm_includes' and select 'copy'
    3. Switch back to Visual Studio
    4. Right-click on the web project in 'Solution Explorer' and select 'paste'.
    5. You should see 'asm_includes' sub-directory appear in your web project.
      The sub-directory should contain AutoSuggestMenu.css, AutoSuggestMenu.js, AutoSuggestMenuItem.js, Blank.html and XUtils.js

Add AutoSuggestMenu control to a web form
  1. Create or open already existing web form
  2. Add the following line to the top of your ASPX page:
    <%@ Register TagPrefix="Custom" Namespace="AutoSuggestMenu" Assembly="AutoSuggestMenu" %>
    
  3. Add the following line to location where you want suggest box to appear
    
    <Custom:AutoSuggestMenu id="Control ID" 
                                targetControlID="ID of the Text Box" 
                                OnGetSuggestions="Server-side method to load suggestions. Defaults to GetSuggestions." 
                                runat="server"/>
    
    

    For example:
    
    <asp:TextBox id="txtCity" runat="server" MaxLength="100" Columns="30" runat="server"/>   
           
    <Custom:AutoSuggestMenu id="asmCity" 
                                targetControlID="txtCity" 
                                OnGetSuggestions="GetCitySuggestions" 
                                runat="server"/>
    
    
  4. If your "asm_includes" directory is not under root of your web application - you can point to it using AutoSuggestMenu.ResourcesDir property.
    
    <Custom:AutoSuggestMenu id="asmCity" 
                            OnGetSuggestions="GetCitySuggestions" 
                            ResourcesDir="~/Includes/AutoSuggestMenu" 
                            runat="server"/>
                            
    

    NOTE: By default the ResourcesDir is "~/asm_includes".

Loading suggestions
When user starts typing in a text box you need to load suggestions depending on what the user typed.

There are several ways to load suggestions from the server side. Please click here for detailed descriptions of various approaches.

Now build it and ENJOY!!!
If you encounter any problems please contact us here

© 2008 ENTech Solutions    All Rights Reserved