2012年3月24日土曜日

returning undefined values in autocomplete textbox

Hi ,

I am using autocomplete textbox in my applocation using webservices. When i was running the applications i am getting values in the div as undefined

here's my html code:

<asp:ScriptManagerID="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:TextBoxID="TextBoxSiteNumber"Width="130px"runat="server"AutoPostBack="true"></asp:TextBox><asp:ImageButtonID="ddlSite"ImageUrl="../../Images/listarrow2.png"runat="server"ImageAlign="AbsMiddle"/>

<cc4:AutoCompleteExtenderID="AutoCompleteExtender1"CompletionInterval="1000"EnableCaching="true"ServiceMethod="GetSiteInfo"ServicePath="~/WebService1.asmx"MinimumPrefixLength="1"TargetControlID="TextBoxSiteNumber"runat="server"completionlistelementid="AutoComplete"FirstRowSelected="true"CompletionListCssClass="autoComplete">

</cc4:AutoCompleteExtender>

<divid="AutoComplete">

</div>

I wrote code in webservice1.asmx as follows:

<WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicFunction GetSiteInfo(ByVal prefixTextAsString)AsString()

Dim countAsInteger = 10

Dim sqlAsString ="Select distinct Top 5 UN_BREF from DM_UNIT Where UN_BREF like @dotnet.itags.org.prefixText"

Dim SQLConAsNew System.Data.SqlClient.SqlConnection("Server=orbis6;User Id=tims;Password=tims;Database=REGIS")

Dim daAs SqlDataAdapter =New SqlDataAdapter(sql, SQLCon)

da.SelectCommand.Parameters.Add("@dotnet.itags.org.prefixText", SqlDbType.VarChar, 50).Value = (prefixText +"%")Dim dtAs DataTable =New DataTable

da.Fill(dt)

Dim items()AsString =NewString((dt.Rows.Count) - 1) {}

Dim iAsInteger = 0

ForEach drAs DataRowIn dt.Rows

items.SetValue(dr("UN_BREF").ToString(), i)

i = (i + 1)

Next

Return items

EndFunction

My web.config file looks as follows:

<httpHandlers>

<removeverb="*"path="*.asmx"/>

<addverb="*"path="*.asmx"validate="false"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addverb="GET,HEAD"path="ScriptResource.axd"type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"validate="false"/>

</httpHandlers>

<httpModules>

<addname="ScriptModule"type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</httpModules>

Please anyone help me

Thanks in advance

Please anyone reply to this post. its very urgent to implement in my application. Waiting for anyone's reply

Thanks In Advance


<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/WebService1.asmx" />
</Services>
</asp:ScriptManager>



Hi ,

I solved it with the help of following link

http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=13342

Thanks

0 件のコメント:

コメントを投稿