Atlas AutoCompleteExtender not working...
- From: Michael Appelmans <news24@xxxxxxxxxx>
- Date: Tue, 27 Jun 2006 14:22:05 +0000 (UTC)
I have essentially copied the samplelist2.aspx from the Atlas samples but the autocomplete feature is not working in my page. The web service asmx works from a browser. Thanks for any suggestions on how to diagnose this.
Here is my aspx code:
<atlas:ScriptManager ID="scriptmanager1" EnablePartialRendering="true" runat="Server" />
<asp:Panel ID="Panel1" runat="server" style="margin-top:10px;padding-left:20px;" Height="24px" Width="640px">
<atlas:UpdatePanel ID="UpdatePanel1" Mode="Conditional" runat="server">
<ContentTemplate>
<asp:Label ID="ShowLabel" runat="server" CssClass="waLabel">Show: </asp:Label>
<asp:DropDownList ID="SearchModeDropDownList" runat="server" AutoPostBack="True" CssClass="waDdl">
<asp:ListItem Selected="True" Value="0">All</asp:ListItem>
<asp:ListItem Value="1">Search</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="SearchLocationNameTextBox" runat="server" CssClass="waTextBox"></asp:TextBox>
<asp:Button ID="SearchBtn" CssClass="waButton" Text=" >> "
CommandName="search" CommandArgument="-2" runat="server" />
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>
<atlas:AutoCompleteExtender ID="AutoCompleteSearch" runat="server">
<atlas:AutoCompleteProperties TargetControlID="SearchLocationNameTextBox" Enabled="true" ServicePath="VanPoolService.asmx"
ServiceMethod="GetLocationNames" MinimumPrefixLength="1"/>
</atlas:AutoCompleteExtender>
Here is my web service code:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class VanPoolService : System.Web.Services.WebService {
public VanPoolService() {
}
[WebMethod]
public string[] GetLocationNames(string prefixText, int count)
{
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["cobbcc"].ConnectionString);
SqlCommand cmd = new SqlCommand(
"SELECT DISTINCT TOP(@nrows) Name FROM Locations WHERE Name like @term", cn);
cmd.Parameters.Add("nrows", count);
cmd.Parameters.Add("term", prefixText + "%");
List<string> suggestions = new List<string>();
cn.Open();
using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while (dr.Read()) suggestions.Add(dr[0].ToString());
}
return suggestions.ToArray();
}
}
.
- Prev by Date: Re: Question about Roles
- Next by Date: Re: Calling a C# from
- Previous by thread: automating email with links to records just submitted to an SQL DB using asp.net (vb)
- Next by thread: Web Parts on ASP.NET 2
- Index(es):