Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 24th, 2009, 07:33 AM
Registered User
 
Join Date: Oct 2007
Location: New Mumbai, Maharashtra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to use AutoCompleteExtender

Hello Masters,
I follow ASP.Net 3.5 as a sheep in herd, but AutoCompleteExtender is not working as it is supposed to... Pls see the code I've used

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AutoCompleteText.aspx.vb" Inherits="AutoCompleteText" %>

<%@ 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>AutoCompleteText</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True" ServiceMethod="GetCompletionList"
TargetControlID="TextBox1" UseContextKey="True">
</cc1:AutoCompleteExtender>

</div>
</form>
</body>
</html>



Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.SqlClient
Partial Class AutoCompleteText
Inherits System.Web.UI.Page
<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute() > _
Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
Dim conn As SqlConnection
Dim cmd As SqlCommand
Dim conn_str As String = "Data Source=ABC\SQLEXPRESS;Initial Catalog=VWDB;Integrated Security=True"
Dim cmdStr As String = "SELECT DISTINCT strUser_Firstname FROM tblUserMaster WHERE UPPER(strUser_Firstname) LIKE UPPER('" & prefixText & "%') order by strUser_Firstname"
conn = New SqlConnection(conn_str)
cmd = New SqlCommand(cmdStr, conn)
conn.Open()
Dim MyReader As SqlDataReader
Dim returnData As List(Of String) = New List(Of String)
MyReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While MyReader.Read
returnData.Add(MyReader("strUser_Firstname").ToStr ing())
End While
Return returnData.ToArray()
End Function
End Class

It does not given any error but it also does not show the rows expected

Please suggest what wrong I'm doing.

Thanks in advance
abhinaybuiss
__________________
Abhinay Tharwal
Reply With Quote
  #2 (permalink)  
Old June 24th, 2009, 12:36 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Have you tested your command SQL to see if it actually returns any data?
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
Reply With Quote
  #3 (permalink)  
Old June 25th, 2009, 02:35 AM
Registered User
 
Join Date: Oct 2007
Location: New Mumbai, Maharashtra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Lee,
Yes the SQL returns records.

Thanks
abhinaybuiss
__________________
Abhinay Tharwal

Last edited by abhinaybuiss; July 18th, 2009 at 01:00 AM. Reason: Reminder
Reply With Quote
  #4 (permalink)  
Old July 18th, 2009, 01:02 AM
Registered User
 
Join Date: Oct 2007
Location: New Mumbai, Maharashtra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation No reply yet

Dear Masters,
Pls suggest, as I'm not able to use the control.

Abhinay
__________________
Abhinay Tharwal
Reply With Quote
  #5 (permalink)  
Old August 21st, 2009, 02:25 AM
Authorized User
 
Join Date: Jun 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default Give you the suggestion

Hi,friend!
Code:
<cc1:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" 
            DelimiterCharacters="" Enabled="True" ServiceMethod="GetCompletionList" 
            TargetControlID="TextBox1" UseContextKey="True">
        </cc1:AutoCompleteExtender>
Actually,there is another property "ServicePath" you didn't add to AutoCompleteExtender . I think it's the problem that you haven't seen the result.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Control Toolkit AutoCompleteExtender ilegend .NET Framework 3.5 0 September 24th, 2008 03:50 AM
unable to connect sultan SQL Server 2005 1 June 6th, 2008 03:38 PM
Unable to create database. rupen SQL Server 2005 4 December 6th, 2007 01:39 AM
Unable to get the project etc.. MoeShall BOOK: ASP.NET Website Programming Problem-Design-Solution 1 April 8th, 2005 07:12 AM
Unable to Update phungleon Access ASP 5 March 18th, 2004 04:23 AM



All times are GMT -4. The time now is 10:29 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.