AutoCompleteExtender only returnes ‘undefined’

I was making a simple Ajax solution for an application running in Sharepoint context in the 12 layout hive (aka application page). I needed a textbox where the user could start typing a job title and the system would suggest previous titles stored in a database. A perfect task for the AutoCompleteExtender.

The problem was that after writing the necessary 3 letters in the textbox I only got a looong list of ‘undefined’ entries. I tried to debug the webservice, but my code seemed never to run. I Googled and found others having the same problem, but their problem was caused by the fact that they returned only integers and not text.

I needed to find out what was happening in the background, so I started Fiddler and ran my solution, typed in a few characters and found this result from the server:

<span id="ctl00_PlaceHolderMain_LabelMessage">Could not create type 'Itera.IDM.Web._12.TEMPLATE.Layouts.IteraIDM.TitleService'.&nbsp;&nbsp; at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName) <br>&nbsp;&nbsp;&nbsp;at System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults results) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) <br>&nbsp;&nbsp;&nbsp;at System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) <br>&nbsp;&nbsp;&nbsp;at System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods, Boolean inlineScript) <br>&nbsp;&nbsp;&nbsp;at System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context) <br>&nbsp;&nbsp;&nbsp;at System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) <br>&nbsp;&nbsp;&nbsp;at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) <br>&nbsp;&nbsp;&nbsp;at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) <br>&nbsp;&nbsp;&nbsp;at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() <br>&nbsp;&nbsp;&nbsp;at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</span>

Aha! That namespace didn’t look right!

Since I created the source .aspx and .asmx files in the 12/TEMPLATE/Layouts/[SOLUTION]-folder, both files got an default namespace according this folder, like this: Itera.IDM._12.TEMPLATE.Layouts.IteraIDM. I had refactored it to Itera.IDM.Web and Itera.IDM.Ajax but forgot to update the .asmx file itself. Bummer!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s