AutoComplete mixing up data

Last post 03-06-2008 9:06 AM by joee. 4 replies.

Sort Posts:

  • AutoComplete mixing up data

    02-29-2008, 12:38 PM
    • Participant
      1,728 point Participant
    • joee
    • Member since 11-13-2002, 9:11 AM
    • Posts 374

    Using .NET 3.5 and the latest ControlKit my AutoComplete is not working. Well it's working, but the data that is presented looks all scambled. Here is some of my code:

    <ajaxToolkit:AutoCompleteExtender ID="ext_autoCompletePropName" runat="server" TargetControlID="txtPropName" EnableCaching="true" MinimumPrefixLength="2" ServicePath="webservices/AutoComplete.asmx" ServiceMethod="AutoCompletePropName" CompletionSetCount="12" CompletionInterval="1000" />

    [WebMethod]
    public string[] AutoCompletePropName(string prefixText, int count)
    {
    if (count == 0)

    count = 10;

    DataTable dt = new DataTable();

    dt = Queries.AutoComplete(prefixText,"AutoCompletePropName");

    string[] items = new string[dt.Rows.Count];

    int i = 0;foreach (DataRow dr in dt.Rows)

    {

    items.SetValue(dr[
    "spropertyname"].ToString(), i);

    i++;

    }

    dt.Dispose();

    return items;

    }

  • Re: AutoComplete mixing up data

    02-29-2008, 12:58 PM
    • Member
      56 point Member
    • smokinmunky
    • Member since 12-27-2005, 2:46 PM
    • Thunder Bay, ON
    • Posts 12

    what are the value's that your database query is returning?

    What's the code look like for the actual db query? 

     

  • Re: AutoComplete mixing up data

    03-03-2008, 8:30 AM
    • Participant
      1,728 point Participant
    • joee
    • Member since 11-13-2002, 9:11 AM
    • Posts 374

    This was working without any issues until I went to the .NET 3.5 ControlKit dll. 

    I am using Oracle and this is the query:

    SELECT DISTINCT spropertyname
    FROM view_usaa_acqproperties
    WHERE UPPER(spropertyname) LIKE UPPER(p_value || '%')
    ORDER BY spropertyname

    If p_value where to equal 'JC' then the results would be this:

    JC Penney
    JC Penney Building
    JC Penney Department Store
    JC Penney Distribution Center
    JC Penney Headquarters Facilit

     

  • Re: AutoComplete mixing up data

    03-06-2008, 6:24 AM
    Answer

    Hi Joee,

    When you are using .NET Framework 3.5,  please make sure that your AJAX Control Toolkit is the right version which supports .NET Framwork 3.5.  Also you should replace the reference(AjaxControlToolkit.dll) in your project and modify its web.config to target the changes.  Here is the sample web.config. 

    <configuration>
    	<configSections>
    		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
    					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    					<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><connectionStrings>
    			</connectionStrings>
    	<system.web>
    		<authentication mode="Forms"></authentication>
    		<pages theme="Simple">
    			<controls>
    				<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
    				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls>
    		
    		</pages>
    		<!--
              Set compilation debug="true" to insert debugging
              symbols into the compiled page. Because this
              affects performance, set this value to true only
              during development.
        -->
    		<compilation debug="true">
    			<assemblies>
    				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
    		</compilation>
    		<httpHandlers>
    			<remove verb="*" path="*.asmx"/>
    			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers>
    		<httpModules>
    			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web>
    	<system.webServer>
    			<validation validateIntegratedModeConfiguration="false"/>
    		<modules>
    			<remove name="ScriptModule"/>
    			<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
    		<handlers>
    			<remove name="WebServiceHandlerFactory-Integrated"/>
    			<remove name="ScriptHandlerFactory"/>
    			<remove name="ScriptHandlerFactoryAppServices"/>
    			<remove name="ScriptResource"/>
    			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    			<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
    	<system.codedom>
    			<compilers>
    				<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
    					<providerOption name="CompilerVersion" value="v3.5"/>
    					<providerOption name="WarnAsError" value="false"/></compiler>
    				<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
    					<providerOption name="CompilerVersion" value="v3.5"/>
    					<providerOption name="OptionInfer" value="true"/>
    					<providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
    	<runtime>
    		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
    			<dependentAssembly>
    				<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    				<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>
    

     Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: AutoComplete mixing up data

    03-06-2008, 9:06 AM
    Answer
    • Participant
      1,728 point Participant
    • joee
    • Member since 11-13-2002, 9:11 AM
    • Posts 374

    Thanks Jonathan. I was able to figure out what was going on. I spent the better half of a day trying to figure it out. Turns out my CSS for all <li> tags in my <div> tag was causing the problem. I had set <li> to list-style-type:none and this was hosing the AutoComplete list. I guess starting in version 10606 AutoComplete rendered as list item. No biggy, but it took some time to figure out. Just gald I was able to finally get it working.

Page 1 of 1 (5 items)