Results 1 to 40 of 82

Thread: [RESOLVED] How to Use Ajaxcontroltoolki autocomplete with database data

Threaded View

  1. #11

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: How to Use Ajaxcontroltoolki autocomplete with database data

    now i did this, added ' around the following:
    Code:
    '<&#37;= this.occupation.ClientID %>'
    ain't getting an error now. purpose of the javascript is to assign the selected items value to the hiddenfield. Haven't got there yet. I just do an alert to test if i get the value successfully. now i get null returned.

    the source is like this for the javascript:

    Code:
    <script type="text/javascript">
    //<![CDATA[
    function IAmSelected( source, eventArgs ) { alert($get('<%= this.occupation.ClientID %>'));}//]]>
    </script>
    and for the occupation textbox extenders:

    Code:
    Sys.Application.add_init(function() {
        $create(AjaxControlToolkit.AutoCompleteBehavior, {"completionListCssClass":"autocomplete_list","completionListItemCssClass":"autocomplete_listItem","delimiterCharacters":"","highlightedItemCssClass":"autocomplete_highlighted_listitem","id":"ctl00_ContentPlaceHolder1_GuardianRepeater_ctl01_OccAutoCompleteExtender","minimumPrefixLength":2,"serviceMethod":"GetOccupations","servicePath":"ClService.asmx"}, {"itemSelected":IAmSelected}, null, $get("ctl00_ContentPlaceHolder1_GuardianRepeater_ctl01_occupation"));
    });
    Code:
    Sys.Application.add_init(function() {
        $create(AjaxControlToolkit.AutoCompleteBehavior, {"completionListCssClass":"autocomplete_list","completionListItemCssClass":"autocomplete_listItem","delimiterCharacters":"","highlightedItemCssClass":"autocomplete_highlighted_listitem","id":"ctl00_ContentPlaceHolder1_GuardianRepeater_ctl03_OccAutoCompleteExtender","minimumPrefixLength":2,"serviceMethod":"GetOccupations","servicePath":"ClService.asmx"}, {"itemSelected":IAmSelected}, null, $get("ctl00_ContentPlaceHolder1_GuardianRepeater_ctl03_occupation"));
    });
    Last edited by Nitesh; Aug 18th, 2009 at 06:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width