Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:37:25+00:00 2026-06-11T05:37:25+00:00

I built a ASP.NET Webapplication and I have a TextBox where a User can

  • 0

I built a ASP.NET Webapplication and I have a TextBox where a User can find a other User. For this I want use the AutoCompleteExtender from AjaxToolKit. The Data I get from the Active Directory. If I start my Page the Application create a DataTable with all UserDate from ActiveDirectory and my Question is.

Can I use a DataTabe for the Informations in a AutoCompleteExtender? If I can use this how I can use this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:37:26+00:00Added an answer on June 11, 2026 at 5:37 am

    According to the official documentation you can’t. Not only you can’t use a DataTable but you must implement a web service and within it, a webmethod with a very specific signature.

    If you don’t mind using jQuery, I can show you an example using jQuery.

    Update:

    Using jQuery all you need to do is include the following libraries in your markup:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/ui/1.8.23/jquery-ui.min.js" type="text/javascript"></script>
    

    On your markup, you can add an asp:hiddenElement and the text element that will be used for autocompletion as so:

    <asp:HiddenElement id="hdnAutoComplete" runat="server" />
    <asp:TextBox id="txtAutoComplete" runat="server" />
    

    Now, you just add the following Javascript function:

    $(function(){
    var items = eval($('#<%=hdnAutoComplete.ClientID%>').val());
    
      $( "#<%=txtAutoComplete.ClientID%>" ).autocomplete({
         source: items
       });
    
    });
    

    Finally, you need to set the elements that you are going to use for autocompletion from codebhind. Since you want to use a DataTable, I’ll show you an easy way:

    protected void Page_Load(object sender, EventArgs e)
    {
         DataTable t = ...//your datatable is this
    
         var query = (from c in t.AsEnumerable()
                     select c.Field<string>("NameOfTheColumnYouWant")).ToArray();
    
         //this will create a javascript array on the client-side when it's eval'd 
         hdnAutoComplete.Value = "["+string.Join(",",query)+"]";
    
    }
    

    Read more examples from jQuery UI’s official documentation here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site built using ASP.NET MVC4 that I can publish fine
In an asp.net web application, I have a modal popup built with a Telerik
I have a layered web application that I built with ASP.NET MVC 4, WebAPI
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine
I want to build a webapplication with a Single Page Interface, using ASP.NET MVC.
I have built an ASP.NET MVC 2 website that I am hosting with Rackspace
I have an app built in ASP.NET/C# . I have created a WebSetUp for
I have built an ASP.NET mvc web application and it seems that some of
I have a web application built in asp.net mvc using forms authentication. I am
I have a web application built in Asp.net framework 3.5 (.Net 2008), and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.