Hi All - Hopefully someone can help me out on this as its really
causing me fits... I wish to implement the autocomplete textbox like
the example provided by the AjaxPro Starter kit.  However I cannot get
past issues with addNamespace and Class not defined.  I have tried
multiple examples from this group (I have read ever post regarding
AutoComplete on this Google Group and still cant get it working) - so
now I am at a loss. The problem seems to come from the addNamespace
function so I replaced that as suggested and added the ms.ashx
reference in my web.config but its still not working...  Here is what I
have set up - if someone can see where this is wrong please help!

CLIENT SIDE CODE:
<script src="js/autocomplete.js" type="text/javascript"></script>
<script type="text/javascript">
function init() {
  var x = new MS.Web.AutoCompleteDataTable("txtWaterbody", 10);

  x.getDisplay = function(item) {
    return (item != null ? item.WaterbodyName : "");
  }
  x.getValue = function(item) {
    return (item != null ? item.WaterbodyName.toString().trimRight() :
"");
  }
  x.getData = function() {
    WATER.MapPage.setSearchWaterbody(this.ele.value, this.count,
this.callback.bind(this));
  }
}
addEvent(window, "load", init);
</script>



WEB.CONFIG FILE
<configSections>
        <sectionGroup name="ajaxNet">
          <section name="ajaxSettings"
type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro"/>
        </sectionGroup>
        </configSections>
        <ajaxNet>
        <ajaxSettings>
                  <oldStyle>
                          <includeMsPrototype/>
                  </oldStyle>
        </ajaxSettings>
        </ajaxNet>

  <system.web>
        <httpHandlers>
          <add verb="POST,GET" path="ajaxpro/*.ashx"
type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
        </httpHandlers>
  </system.web>



ADDED the following to AUTOCOMPLETE.JS FILE
if(typeof MS == "undefined") MS = {};
if(typeof MS.Web == "undefined") MS.Web = {};
if(typeof MS.Web.AutoComplete == "undefined") MS.Web.AutoComplete = {};




CODE-BEHIND FILE
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        AjaxPro.Utility.RegisterTypeForAjax(GetType(WATER.MapPage))
End Sub

 <AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)>
Public Function setSearchWaterbody(ByVal srchtxt As String, ByVal cval
As Integer) As ajaxReturn
        Dim geoService As geoWaterbody.Waterbody
        Dim ds As DataSet

        Try
            ds = geoService.getWaterbody(srchtxt)

        Catch ex As Exception

        End Try
          Return ds.Tables[0]
    End Function


can someone please help me out?  thanks!!!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to