Click here to Skip to main content
15,888,351 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionajax autocomplete extender control Pin
MallikarjunaGupta20-Feb-10 3:02
MallikarjunaGupta20-Feb-10 3:02 
AnswerRe: ajax autocomplete extender control Pin
Not Active20-Feb-10 3:24
mentorNot Active20-Feb-10 3:24 
GeneralRe: ajax autocomplete extender control Pin
MallikarjunaGupta20-Feb-10 3:29
MallikarjunaGupta20-Feb-10 3:29 
GeneralRe: ajax autocomplete extender control Pin
Not Active20-Feb-10 3:33
mentorNot Active20-Feb-10 3:33 
GeneralRe: ajax autocomplete extender control Pin
MallikarjunaGupta20-Feb-10 3:39
MallikarjunaGupta20-Feb-10 3:39 
GeneralRe: ajax autocomplete extender control Pin
Not Active20-Feb-10 3:53
mentorNot Active20-Feb-10 3:53 
AnswerIGNORE REPORT Pin
Not Active20-Feb-10 3:34
mentorNot Active20-Feb-10 3:34 
Questionajax AutoCompleteExtender is not working Pin
MallikarjunaGupta20-Feb-10 1:09
MallikarjunaGupta20-Feb-10 1:09 
Hi i am writing the code in aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" 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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
<Services>
<asp:ServiceReference Path="MyAutocompleteService.asmx" />
</Services>
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<div id="divWidth">
</div>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" ServicePath="MyAutocompleteService.asmx"
ServiceMethod="GetEmailsIdString" TargetControlID="TextBox1" MinimumPrefixLength="1"
CompletionInterval="10" EnableCaching="true" CompletionSetCount="12" CompletionListCssClass="AutoExtender"
CompletionListItemCssClass="AutoExtenderList" CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
CompletionListElementID="divWidth">
</cc1:AutoCompleteExtender>
</div>
</form>
</body>
</html>


in webservice


using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections.Generic;
using System.Xml;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
/// <summary>
/// Summary description for MyAutocompleteService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class MyAutocompleteService : System.Web.Services.WebService
{
public MyAutocompleteService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string[] GetSuggestions(string prefixText, int count)
{
List<string> responses = new List<string>();
for (int i = 0; i < count; i++)
responses.Add(prefixText + (char)(i + 65));
return responses.ToArray();
}
[WebMethod]
public string[] GetEmailsIdString(string prefixText, int count)
{
List<string> responses = new List<string>();
DataSet ds = new DataSet();
string conString = ConfigurationManager.ConnectionStrings["SqlOpenRopes"].ToString();
SqlConnection con = new SqlConnection(conString);
con.Open();
SqlDataAdapter da;
SqlCommand sqlCmd = new SqlCommand();
sqlCmd = new SqlCommand("SELECT ReservationId,Email FROM Reservations where email !='' AND Email Like '" + prefixText + "%'", con);
da = new SqlDataAdapter(sqlCmd);
da.Fill(ds);
if (ds != null)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
responses.Add(ds.Tables[0].Rows[i]["Email"].ToString());
}
con.Close();
//for (int i = 0; i < count; i++)
// responses.Add(prefixText + (char)(i + 65));
return responses.ToArray();
}
}

when running this code is executed the code but the output is not displaying what changes i want to do......
AnswerRe: ajax AutoCompleteExtender is not working Pin
s.mn20-Feb-10 1:39
s.mn20-Feb-10 1:39 
AnswerRe: ajax AutoCompleteExtender is not working Pin
Not Active20-Feb-10 3:23
mentorNot Active20-Feb-10 3:23 
Questionhow to get automatic no in alpha numeric no from database Pin
developerit20-Feb-10 0:21
developerit20-Feb-10 0:21 
AnswerRe: how to get automatic no in alpha numeric no from database Pin
CoderOnline20-Feb-10 1:02
CoderOnline20-Feb-10 1:02 
AnswerRe: how to get automatic no in alpha numeric no from database Pin
Bajrang Singh20-Feb-10 1:13
Bajrang Singh20-Feb-10 1:13 
QuestionWeb Application Pin
vipinsethumadhavan19-Feb-10 21:58
vipinsethumadhavan19-Feb-10 21:58 
AnswerRe: Web Application Pin
Chetan Patel19-Feb-10 23:06
Chetan Patel19-Feb-10 23:06 
AnswerRe: Web Application Pin
Abhijit Jana19-Feb-10 23:09
professionalAbhijit Jana19-Feb-10 23:09 
AnswerRe: Web Application Pin
sashidhar19-Feb-10 23:50
sashidhar19-Feb-10 23:50 
QuestionProblem loading stylesheet Pin
anushh19-Feb-10 21:14
anushh19-Feb-10 21:14 
AnswerRe: Problem loading stylesheet Pin
R. Giskard Reventlov20-Feb-10 0:03
R. Giskard Reventlov20-Feb-10 0:03 
GeneralRe: Problem loading stylesheet Pin
anushh24-Feb-10 14:55
anushh24-Feb-10 14:55 
GeneralClient Side Custom Validation in Asp.Net (AJAX) Pin
saroj sigdel19-Feb-10 19:42
saroj sigdel19-Feb-10 19:42 
QuestionJavascript does not work with firefox browser? Pin
mdrizwan_119-Feb-10 19:35
mdrizwan_119-Feb-10 19:35 
AnswerRe: Javascript does not work with firefox browser? [modified] Pin
ais0720-Feb-10 0:26
ais0720-Feb-10 0:26 
AnswerRe: Javascript does not work with firefox browser? Pin
Palash Biswas21-Feb-10 19:28
Palash Biswas21-Feb-10 19:28 
QuestionComputer NAme Pin
ishwarya mahadevan19-Feb-10 17:52
ishwarya mahadevan19-Feb-10 17:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.