Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesError with ScriptManager when trying to use Auto Complete ExtenderError with ScriptManager when trying to use Auto Complete Extender
Previous
 
Next
New Post
2/5/2010 2:46 PM
 

Hi,

I am trying to use AutoCompleteExtender to make a search as you type search feature in one of my modules. I have been reading a bunch of sites in trying to get this to work (also downloaded a cheap module from snowcovered to try to get it working) If I take out my script manager everything shows up on the page correctly, but the search as you type does not show up at all. It is just like typing in a text box. If I add in the ScriptManager I get the following error:

DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 49604bc8-ce86-45c9-bf23-ef7687655715
InnerException: Object reference not set to an instance of an object.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: DotNetNuke.UI.Containers.ActionButtonList.get_ModuleActions
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Containers.ActionButtonList.get_ModuleActions() at DotNetNuke.UI.Containers.ActionButtonList.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

 

I am trying to make everything as simple as I possibly can but I cant seem to get it to work. Here is a list of my ascx page, ascx.vb page and my webservice AutoComplete.asmx. I have tried doing this enabling and disabling Partial Rendering under the module control but it did not work

Thanks for any help.

Chris

 

 

.ascx page

 

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ContactToPolicy.ascx.vb" Inherits="ACSI.Modules.ClaimsAssociation.ContactToPolicy" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePageMethods = "true">
</asp:ScriptManager>
 
<asp:TextBox ID="txtContactsSearch" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ServiceMethod="SearchCustomers"
    MinimumPrefixLength="2"
    CompletionInterval="100" EnableCaching="false" CompletionSetCount="10"
    TargetControlID="txtContactsSearch"
    ID="AutoCompleteExtender1" runat="server" FirstRowSelected = "false" ServicePath="AutoComplete.asmx">
</cc1:AutoCompleteExtender>

 

ascx.vb page

Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports DotNetNuke.Framework.AJAX
Imports System.Web.UI.ScriptManager

Namespace ACSI.Modules.ClaimsAssociation


    Partial Class ContactToPolicy
        Inherits Entities.Modules.PortalModuleBase

#Region "Private Members"

        Private strTemplate As String

#End Region

#Region "Event Handlers"

        Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

            ' Determine if AJAX is installed

            If DotNetNuke.Framework.AJAX.IsInstalled Then

                DotNetNuke.Framework.AJAX.RegisterScriptManager()

                ' Create a reference to the Script Manager
                Dim objScriptManager As ScriptManager = ScriptManager.GetCurrent(Me.Page)

                ' Add a reference to the web service
                Dim objServiceReference As ServiceReference = New ServiceReference
                objServiceReference.Path = "~/DesktopModules/ClaimsAssociation/AutoComplete.asmx"
                objScriptManager.Services.Add(objServiceReference)


            End If

        End Sub


#End Region


    End Class
End Namespace

 

and the webservice AutoComplete.asmx (the vb portion)

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

'Add Namespace references
Imports System.Collections.Generic
Imports Microsoft.ApplicationBlocks.Data
Imports DotNetNuke.Common.Utilities
Imports System.Data
Imports System.Data.SqlClient
Imports AjaxControlToolkit

'Don't forget to add System.Web.Script.Services.ScriptService attribute
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService

    'String List for return
    Protected returnStr As New List(Of String)

    'Web Method would be called by auto complete extender
    <WebMethod()> _
    Public Shared Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
        Dim ConnectionString As String = "Server=***;Database=***;uid=***;pwd=***;"

        Dim Connection As New SqlConnection(ConnectionString)
        Connection.Open()

        Dim SqlQuery = "select LongName from Contacts where LongName like '%" & prefixText & "%'"
        Dim cmd As SqlCommand = New SqlCommand(SqlQuery, Connection)
        Dim customers As List(Of String) = New List(Of String)
        Dim sdr As SqlDataReader = cmd.ExecuteReader
        While sdr.Read
            customers.Add(sdr("LongName").ToString)
        End While
        Return customers
    End Function


End Class

 



 

 

 

 
New Post
2/8/2010 12:49 PM
 

I have done some more researching and found out that the ScriptManager is already a part of a page in DNN 5.0 So I took it out, I also discovered that there was an error burried in the event viewer saying that only one ScriptManager can be initialized on a page. The page will load but the autocomplete extender will do nothing, If I type it doesnt populate a list.

I did a test with the code that I had and created a new website project and using an AJax Web Form, I copied my code and everything worked perfectly. Is there something that you have to do to get the autocomplete extender working in DNN?

Any help would be greatly appreciated.

 

Chris

 
New Post
2/8/2010 2:30 PM
 

Another Addendum to this thread.

I have it working, sort of...

It may have been working since the beginning. I installed firebug after seeing a reccomendation from a posting on a forum. Started debugging, found a few stupid errors, then it showed the javascript running to grab the returned data, and it shows the data in fire bug, the correct names are returned and everything. But it is not showing in the module, there is no dropdown to see them or anything.

Has anyone had this problem before?

 

Chris

 
New Post
2/22/2010 9:42 AM
 
Has no one used Auto Complete Extender to make a search as you type drop down? My code works outside of DNN perfectly, Its just when it is in a module it stops working. Thanks, Chris
 
New Post
3/11/2010 9:54 AM
 

Bump,

I still have not been able to get this to work. Anyone able to offer any suggestions?

 

Chris

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesError with ScriptManager when trying to use Auto Complete ExtenderError with ScriptManager when trying to use Auto Complete Extender


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out