Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

how to get the dropdown feature when using  AutoCompleteExtender

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rote - 05 Dec 2007 07:19 GMT
If you have a look at this site below you will notice that after typing some
text and the list is too long the textbox will give
you like a dropdown list
http://www.tuyr.net/AutoComplete/AutoComplete.aspx

How can i achieve this i have set all the properties on that page but still
don't get the dropdown list..when my list is too long
Or is there a way to page it etc..
Any ideas what 'm missing
Thanks in Advance
coolCoder - 05 Dec 2007 14:53 GMT
> If you have a look at this site below you will notice that after typing some
> text and the list is too long the textbox will give
[quoted text clipped - 5 lines]
> Any ideas what 'm missing
> Thanks in Advance

There is a property to fetch limited number of records while doing
that.
By the way, have you given path of web service correctly ??
Milosz Skalecki [MCAD] - 05 Dec 2007 21:49 GMT
Howdy,

Paste both aspx & vb.net/c# code.
Signature

Milosz

> If you have a look at this site below you will notice that after typing some
> text and the list is too long the textbox will give
[quoted text clipped - 6 lines]
> Any ideas what 'm missing
> Thanks in Advance
rote - 06 Dec 2007 01:42 GMT
Thanks for the prompt reply.
The snipped code below:-
If i can have it in a dropdlown list it would be nice though as the returned
list is too long or even have a
paging sort of.

<asp:TextBox ID="SearchText" CssClass="Ajaxtextbox" Width="150px"
runat="server" />

<toolkit:AutoCompleteExtender

ID="AutoCompleteSearch"

MinimumPrefixLength="1"

runat="server"

TargetControlID="SearchText"

ServicePath="SimpleListService.asmx"

ServiceMethod="LookUpEmployee"

EnableCaching="true"

CompletionInterval="10"

CompletionSetCount="20"

CompletionListCssClass="completionListElement"

CompletionListItemCssClass="listItem"

CompletionListHighlightedItemCssClass="highlightedListItem"

DelimiterCharacters=";"/>

SimplestListService.asmx
---------------------------------------------
[WebMethod]
public string[] LookUpEmployee(string prefixText,int count)
{
count = 10;
string sql = "select distinct E.FirstName + ' ' + E.LastName AS [Name] from
Employee E where E.firstname like @prefixText order by [Name]";
SqlConnection cn = new SqlConnection();
DataTable dt = new DataTable();

    cn.Open();
    SqlDataAdapter da = new SqlDataAdapter(sql, cn);
    try
    {
    da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar,
50).Value = prefixText + "%";
    da.Fill(dt);
}
finally
{
    if (da != null)
    {
        da.Dispose();
    }

    if (cn != null)
    {
        if (cn.State == ConnectionState.Open)
        {
            cn.Close();
        }
        cn = null;
    }

}
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
 items.SetValue(dr["Name"].ToString(),i);
 i++;
}
return items;
}

> Howdy,
>
[quoted text clipped - 12 lines]
>> Any ideas what 'm missing
>> Thanks in Advance
Milosz Skalecki [MCAD] - 06 Dec 2007 19:24 GMT
Hi Rote,

If you're using page method instead of web service, the method must be static:

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] LookUpEmployee(string prefixText,int count)
{
  // blahblah
}

I'm not sure if the ScriptManager should have EnablePageMethods set to true:
<asp:ScriptManager runat="server" ID="scriptManager"
EanblePageMethods="true"/>

hope this helps
Signature

Milosz

> Thanks for the prompt reply.
> The snipped code below:-
[quoted text clipped - 95 lines]
> >> Any ideas what 'm missing
> >> Thanks in Advance
rote - 08 Dec 2007 09:54 GMT
Thanks for the message Millosz but that didn't answer my question.
The page does work only i want the dropdownlist feature like on this page
type in som text and u will see the textboc change to dropdownlist

http://www.tuyr.net/AutoComplete/AutoComplete.aspx

> Hi Rote,
>
[quoted text clipped - 117 lines]
>> >> Any ideas what 'm missing
>> >> Thanks in Advance
Milosz Skalecki [MCAD] - 08 Dec 2007 16:28 GMT
Howdy,

Aplogies I missed there was a webservice in the code you posted. I can't
really understand the problem - are you able to see the list below your text
box at all? Or is just the "transition" effect we see on the sample control
toolkit page (i suspect is just dropDownExtender in conjunction with
Animations)?

Kind Regards
Signature

Milosz

> Thanks for the message Millosz but that didn't answer my question.
> The page does work only i want the dropdownlist feature like on this page
[quoted text clipped - 123 lines]
> >> >> Any ideas what 'm missing
> >> >> Thanks in Advance
rote - 10 Dec 2007 01:35 GMT
Yes Milosz thats what i'm talking about the
"transition" effect we see on the sample control
toolkit page
at http://www.tuyr.net/AutoComplete/AutoComplete.aspx
Any ideas???

> Howdy,
>
[quoted text clipped - 137 lines]
>> >> >> Any ideas what 'm missing
>> >> >> Thanks in Advance
Milosz Skalecki [MCAD] - 13 Dec 2007 23:49 GMT
Ho again,

As I had mentioned before, use Animations:

<cc1:AutoCompleteExtender runat="server" ID="ex"
    ServiceMethod="GetText"
    TargetControlID="txt">
    <Animations>
        <OnShow>
            <Sequence>
                <OpacityAction Opacity="0" />
                <HideAction Visible="true" />
                <FadeIn />
            </Sequence>
        </OnShow>
        <OnHide>
            <FadeOut Duration=".2"/>
        </OnHide>
    </Animations>
</cc1:AutoCompleteExtender>

hope this helps
Signature

Milosz

> Yes Milosz thats what i'm talking about the
> "transition" effect we see on the sample control
[quoted text clipped - 143 lines]
> >> >> >> Any ideas what 'm missing
> >> >> >> Thanks in Advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.