Jump to content

Ajax Control Tool kit


Guest samhrishi

Recommended Posts

Guest samhrishi

hiFriends i have following code..My problemis thati could not get result in text box like google search text box while there is no error...so how can i get Result like google serch textbox??this is my'''''''Default.aspx '''''' code<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"><title>Untitled Page</title></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="txtContactsSearch" runat="server"></asp:TextBox><asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" ServiceMethod="SearchCustomers" MinimumPrefixLength="2"CompletionInterval="100" EnableCaching="false" CompletionSetCount="10" TargetControlID="txtContactsSearch"FirstRowSelected = "false"></asp:AutoCompleteExtender><asp:Label ID="lblmsg" runat="server"></asp:Label></div></form></body></html>'''''' and this one is my'''''Default.aspx.vbImports System.Data.SqlClientImports System.Collections.GenericPartial Class _DefaultInherits System.Web.UI.Page<System.Web.Script.Services.ScriptMethod(), _System.Web.Services.WebMethod()> _Public Shared Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)Dim conn As SqlConnection = New SqlConnectionconn.ConnectionString = ConfigurationManager _.ConnectionStrings("constr").ConnectionStringDim cmd As SqlCommand = New SqlCommandcmd.CommandText = "select AccountName from Account where" & _" AccountName like @SearchText + '%'"cmd.Parameters.AddWithValue("@SearchText", prefixText)cmd.Connection = connconn.Open()Dim customers As List(Of String) = New List(Of String)Dim sdr As SqlDataReader = cmd.ExecuteReader()While sdr.Readcustomers.Add(sdr("AccountName").ToString)End Whileconn.Close()Return customersEnd FunctionProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadEnd SubEnd Class...Thanks .......

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...