On Tue, Sep 30, 2008 at 4:26 PM, Narayanan Rm <catchn
...@gmail.com> wrote:
> Anil
> Check out this URL
> http://www.asp.net/AJAX/AjaxControlToolkit/Samples/AutoComplete/AutoC...
> On 9/30/08, patis.p...@gmail.com <patis.p...@gmail.com> wrote:
> > Hello to all Professionals,
> > I have create a text box autofill using .asmx file its worling fine
> > here the code
> > But after this when i insert , separator this will repeat all the
> > previous values that is already filled in textbox please guide me or
> > send me how to do this
> > <form id="form1" runat="server">
> > <asp:ScriptManager ID="ScriptManager1" runat="server"
> > EnablePageMethods="true">
> > <Services>
> > <asp:ServiceReference Path="~/autocomplete.asmx" />
> > </Services>
> > </asp:ScriptManager>
> > <asp:TextBox ID="TextBox1" runat="server" Width="266px"></
> > asp:TextBox><div>
> > <cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
> > runat="server"
> > TargetControlID="TextBox1"
> > MinimumPrefixLength="1"
> > ScriptPath="~/autocomplete.asmx"
> > ServiceMethod="ListUser" ServicePath="">
> > </cc1:AutoCompleteExtender>
> > </div>
> > </form>
> > //---------------------
> > [WebMethod]
> > public string[] ListUser(string prefixText)
> > {
> > //return all records whose Title starts with the prefix input
> > string
> > //int count = 10;
> > string sql = "select BhootName from bhoot where bhootname like
> > @prefixText";
> > SqlDataAdapter da = new SqlDataAdapter(sql, "Data
> > Source=vivacity5\\SQLEXPRESS;Initial Catalog=practice;Integrated
> > Security=True");
> > da.SelectCommand.Parameters.Add("@prefixText",
> > SqlDbType.VarChar, 50).Value = prefixText + "%";
> > DataTable dt = new DataTable();
> > da.Fill(dt);
> > string[] items = new string[dt.Rows.Count];
> > int i = 0;
> > foreach (DataRow dr in dt.Rows)
> > {
> > items.SetValue(dr["BhootName"].ToString(), i);
> > i++;
> > }
> > return items;
> > }
> > Regards,
> > Anil
> --
> "The true test of character is not how much we know how to do, but how
> we behave when we don't know what to do."