Answered by:
Drop down box that will let users type if not on the list

Question
-
User38196249 posted
Hello,
I'm a new user of asp.net with limited programming experience. I developed a tool that lets the user edit the data on an SQl database. I wanted to modify my dropdowns in such a way that if a user don't see the data he/she would like to input will allow the user to type in new data. I've search the web and the threads I've read pointed me to use Combo box but its on Ajax control toolkit. Is there an easier way to do this?
Thanks,
newASP_user
Tuesday, October 30, 2012 12:42 PM
Answers
-
User-1360095595 posted
There's also the autocomplete extender from the Ajax control toolkit. There's also jQuery autocomplete widgets that do the same.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 30, 2012 12:51 PM -
User-1360095595 posted
As far as I know the autocomplete extender works on a textbox control. It doesn't work on a DDL.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 30, 2012 2:12 PM
All replies
-
User-1360095595 posted
There's also the autocomplete extender from the Ajax control toolkit. There's also jQuery autocomplete widgets that do the same.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 30, 2012 12:51 PM -
User38196249 posted
Can I just add the autocomplete extender on my asp:dropdownlist?
Tuesday, October 30, 2012 1:38 PM -
User-1360095595 posted
As far as I know the autocomplete extender works on a textbox control. It doesn't work on a DDL.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 30, 2012 2:12 PM -
User1950134874 posted
hi,
try below code
.aspx:
<asp:TextBox ID="txtOtherIncome1" runat="server" QuestionNo="1038" CssClass="txtBox w230 txtsearch"
></asp:TextBox>
<div id="listPlacement" style="overflow-y: scroll;">
</div>
<ACT:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="txtOtherIncome1"
ServiceMethod="BindTableitems" ContextKey="1038" CompletionListElementID="listPlacement"
CompletionSetCount="10" MinimumPrefixLength="0" EnableCaching="true" />
<asp:RequiredFieldValidator ID="rfvtxtOtherIncome1" runat="server" ControlToValidate="txtOtherIncome1"
ValidationGroup="MonIncSave" Display="None" SetFocusOnError="True"
Width="8px"></asp:RequiredFieldValidator>.vb
<System.Web.Script.Services.ScriptMethod(), _
System.Web.Services.WebMethod()> _
Public Shared Function BindTableitems(ByVal prefixText As String, ByVal contextKey As String) As List(Of String)
Try
If Not HttpContext.Current.Session("ID") Is Nothing Then
' GetTableItemValues() your function goes here
End Using
Else
Return Nothing
End If
Catch ex As Exception
Return Nothing
End Try
End FunctionThanks,
G suresh
Thursday, November 1, 2012 8:37 AM