Hi;
i'm trying to add autocomplete functionality to a webpage that has a
masterpage. in javascript i'm writng the code below but it gaves that
the default3 is undefined.

<%@ Page Language="C#" MasterPageFile="~/ekol2cnew.master"
AutoEventWireup="true"
    CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled
Page" %>

....
....
....
<asp:Content ID="Content1" ContentPlaceHolderID="ekol_Content"
runat="Server">
....
....
....
        <script type="text/javascript"
src="scripts/autocomplete.js"></script>

        <script type="text/javascript">
function init() {
        var x = new
MS.Web.AutoCompleteDataTable("ctl00_ekol_Content_WebPanel1_txt_criteria1",
10);

        x.getDisplay = function(item) {
                return (item != null ? item.CustomerName : "");
        }
        x.getValue = function(item) {
                // return item.CustomerID;
                return (item != null ? item.CustomerName.toString().trimRight() 
:
"");
        }
        x.getData = function() {
                Default3.Search(this.ele.value, this.count,
this.callback.bind(this));
        }

        var y = new
MS.Web.AutoCompleteDataTable("ctl00_ekol_Content_WebPanel1_txt_criteria2",
10);

        y.getDisplay = function(item) {
                return (item != null ? item.CustomerName : "");
        }
        y.getValue = function(item) {
                // return item.CustomerID;
                return (item != null ? item.CustomerName.toString().trimRight() 
:
"");
        }
        y.getData = function() {
                Default3.Search(this.ele.value, this.count,
this.callback.bind(this));
        }
}

setTimeout(init, 1);
        </script>
</asp:Content>


--~--~---------~--~----~------------~-------~--~----~
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