Click here to Skip to main content
16,019,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I am having an issue with Autocomplete extender, its completionlist item having value containing '-' sign, but in completeextender its giving dirty value...
Plz find details as below:

ASP.NET
<asp:TextBox ID="txtMAWBNo" AutoPostBack="true" runat="server" Width="90px">
                       <cc2:AutoCompleteExtender ID="AutoCompleteExtender2"  runat="server" TargetControlID="txtMAWBNo"
                           EnableCaching="true" ServicePath="~/AutoComplete.asmx" ServiceMethod="getMAWBNOFORSBUpdate"
                            DelimiterCharacters=";, :"
                           MinimumPrefixLength="2" CompletionListHighlightedItemCssClass="SelectedItem"
                           CompletionListItemCssClass="ItemListWidth" CompletionListCssClass="ListCss"  önClientPopulated="AjaxAutoCompleteTooltip">


And in web service code as:

VB
<webmethod()> _
<Script.Services.ScriptMethod()> _
Public Function getMAWBNOFORSBUpdate(ByVal prefixText As String, ByVal count As Integer) As Array
        Dim strCommand As String = Nothing
        Dim ReturnArr As New ArrayList
        Dim dtReturn As DataTable = Nothing
        Try           
           strCommand = "select Distinct isnull(MBLNo,'') as MBLNo from tbl_EximEntExportSeaMasterBooking where _Deleted=0 AND  MBLNo like '%" & prefixText & "%' and ISNULL(IsBVC,0)=1  order by MBLNo"
            objCommon = New DMLControl.SQLControl
            dtReturn = objCommon.FetchDataTable(strCommand, clsSQLConnection.ConnectionString)
            With dtReturn
                For i As Integer = 0 To .Rows.Count - 1
                    ReturnArr.Add(Convert.ToString(.Rows(i).Item("MBLNo")))
                Next
            End With
            Return ReturnArr.ToArray
        Catch ex As Exception
        End Try
        Return ReturnArr.ToArray
    End Function

MBLNo has value 75-01060 but its showing -485 in autocomplete extender..
Can someone help me out plz.....
Thanks...
Posted
Updated 9-Aug-12 23:25pm
v2
Comments
SinghPrateek 24-Aug-12 13:14pm    
Instead on returning ArrrayList, can you List<string>.

List<string> returnList = new List<string>();

// code to fill the list

return returnList.ToArray();

PS: the snippet is in c#

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900