#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Apr 2010
    Posts
    14
    Rep Power
    0

    Autocompelete not firing !!


    hello peopl am new at these ajax thing but i had read enough about autocompelete extender

    then i attached ajax toolkit to my vs2008 and it attached well

    the problem is that i did every thing to make it work and it didnt

    please guys if anyone can solve this problem make post and help

    first i have the web service code in here
    Code:
    using System; 
    using System.Configuration; 
    using System.Data; 
    using System.D 
     
    ata.SqlClient; 
    using System.Web; 
    using System.Collections; 
    using System.Web.Services; 
    using System.Web.Services.Protocols; 
    using System.Web.Script.Services; 
    using System.Configuration; 
     
    /// <summary> 
    /// Summary description for WebService 
    /// </summary> 
    // [ScriptService] 
    [System.Web.Script.Services.ScriptService()] 
    [WebService(Namespace = "http://tempuri.org/")] 
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
     
    public class WebService : System.Web.Services.WebService 
    { 
        public WebService() 
        { 
            //Uncomment the following line if using designed components 
            //InitializeComponent(); 
        } 
        [WebMethod] 
        //[System.Web.Script.Services.ScriptService] 
           public string[] GetCountriesList(string prefixText, int count) 
        { 
            DataSet dtst = new DataSet(); 
     
            SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); 
     
            string strSql = "SELECT student_name FROM student  WHERE student_name LIKE '" + prefixText + "%' "; 
     
            SqlCommand sqlComd = new SqlCommand(strSql, sqlCon); 
     
            sqlCon.Open(); 
     
            SqlDataAdapter sqlAdpt = new SqlDataAdapter(); 
     
            sqlAdpt.SelectCommand = sqlComd; 
     
            sqlAdpt.Fill(dtst); 
     
            string[] cntName = new string[dtst.Tables[0].Rows.Count]; 
     
            int i = 0; 
     
            try 
            { 
     
                foreach (DataRow rdr in dtst.Tables[0].Rows) 
                { 
     
                    cntName.SetValue(rdr["student_name"].ToString(), i); 
     
                    i++; 
     
                } 
     
            } 
     
            catch { } 
     
            finally 
            { 
     
                sqlCon.Close(); 
     
            } 
     
            return cntName; 
     
        } 
     
    }
    then the asp default page
    Code:
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %> 
      
     
      
     
     
     
    <!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 runat="server"> 
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"> 
         
     
        <asp:ScriptManager ID="ScriptManager1" runat="server"> 
                    <Services> 
     
                    <asp:ServiceReference Path="AWebService.asmx" /> 
     
                </Services> 
     
        </asp:ScriptManager> 
        <asp:TextBox ID="TextBox1" runat="server" Height="22px" Width="536px"></asp:TextBox> 
       
        <div> 
         
            <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"  
                          ServiceMethod="GetCountriesList"  
                ServicePath="WebService.asmx" TargetControlID="TextBox1" UseContextKey="False" MinimumPrefixLength="1"> 
            </cc1:AutoCompleteExtender> 
         
        </div> 
        
        </form> 
    </body> 
    </html>
    and here is my project link with db so u can try it in your pcs
    http://www.mediafire.com/?3wmyyghnjmy
    nothing happen after all this code
  2. #2
  3. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2926
    --moved to the .NET forum, ASP forum is for classic ASP only.
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Apr 2010
    Posts
    14
    Rep Power
    0
    if some one could help am waiting i really7 need that issue
  6. #4
  7. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Aug 2008
    Location
    USA
    Posts
    1,606
    Rep Power
    348
    if you don't mine then can u plz try this simple way

    i have try it on my some of application its really easy and simple too

    Jquery Autocomplete
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

    Jquery Shake Effect ,
    Andriod KitKat


    Thank You,
    KiranK
  8. #5
  9. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Apr 2010
    Posts
    14
    Rep Power
    0
    thanks mr mark
    but i need to do it with ajax and fetch data from data base
    for example i have list of students in my db so i wanna
    when user select m into the text box textbox checking out db and return list with names starts with m and so on
  10. #6
  11. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Aug 2008
    Location
    USA
    Posts
    1,606
    Rep Power
    348
    yes dear its base on ajax only ( jquery is part of ajax)
    and as your talking its same
    just try the demo , you will come to know

Similar Threads

  1. Firing javascript from asp form
    By moris in forum ASP Development
    Replies: 9
    Last Post: February 12th, 2007, 11:55 PM
  2. Requiredfieldvalidators firing before Customvalidators
    By ShinyCDMan in forum .NET Development
    Replies: 1
    Last Post: April 17th, 2006, 05:39 PM
  3. Firing an email based on the current date.
    By mdateeq2003 in forum .NET Development
    Replies: 3
    Last Post: April 10th, 2006, 03:52 AM
  4. Events Stop Firing
    By crich in forum .NET Development
    Replies: 3
    Last Post: July 25th, 2005, 10:29 AM
  5. Japan again in the firing line over whaling proposals (AFP)
    By RSS_News_User in forum Science News
    Replies: 0
    Last Post: June 21st, 2005, 11:02 PM

IMN logo majestic logo threadwatch logo seochat tools logo