I have tried implementing the DNNTextSuggest control on a custom module I am building. However, I am getting a '404 - control not found' error.
I believe the problem is either related to the control being on a nested user control, or because it is in an EditItemTemplate on a DataList.
I came to this conclusion because I implemented an identical version of the control at the 'base' level of the Module user control, and it works perfectly.
Here's the details:
- control 1 : implemented straight onto the module user control
<dnn:DNNTextSuggest id="txtCountryName" runat="server" OnPopulateOnDemand="txtCountryName_PopulateOnDemand"/>
</view org>
This works exactly as expected.
- control 2 : sits on another user control inside an EditItemTemplate of a DataList, which sits on another user control, which sits on the module user control.
ie.
<view org (the module control)>
<ctl:editOrg runat="server">
</view org>
<editOrg>
<data list>
<EditItemTemplate>
<ctl:editAddress>
</EditItemTemplate>
<editAddress>
<
dnn:DNNTextSuggest id="txtCountryName" runat="server" OnPopulateOnDemand="txtCountryName_PopulateOnDemand"/>
</editAddress>
</data list>
</editOrg>
The same information, put another way ->
<viewOrg><ctl:editOrg><asp:datalist><editItemTemplate><ctl:editAddress>
<dnn:dnnTextSuggest>
</ctl:editAdress></editItemTemplate></asp:datalist></ctl:editOrg></viewOrg>
Now the 1st DnnTextEdit control works fine, but the 2nd fails with the 404 error.
Tracing the calls with Fiddler, I get the two different requests:
<control 1 : works OK>
__DNNCAPISCI=txtCountryName dnn_ctr386_ViewOrg_txtCountryName&__DNNCAPISCP=a
<control 2 :fails with 404>
__DNNCAPISCI=txtCountryName dnn_ctr386_ViewOrg_editOrg_dlAddresses_ctl00_ctlEditAddress_txtCountryName&__DNNCAPISCP=a
Now if you do a 'view source' on the page, the two controls are easily found within the generated Html. But I haven't bothered to step down to the next level of debugging because I've already spent too much time on it.
I'm assuming that because of the need for the 'FindControl' call with a bound datalist event, that the AJAX code can't find the control to show the drop-down part of it, and that's why it fails with a '404 control not found'. I think that the fact that it is embedded within user controls is actually superfluous - it's the editItemTemplate part that is causing the error.
For my own project, I've dropped the use of the text suggest on the datalist bound controls and replaced it with a normal drop down list, but it would be good if the DNNTextSuggest box could handle this type of scenario, as I imagine it is pretty common in Module coding.
Comments welcome, in case I am doing something stoopid which is causing the error.
<view org (the module control)>