This is what I normally do:
Dim oEntries As AutoCompleteBoxEntryCollection = Me.ddlItemNumber2.Entries
If oEntries.Count > 0 Then
'be sure there is at least on entry in the autocompletebox
Session("itemnmbr") = Me.ddlItemNumber2.Entries(0).Text
Response.Redirect("somepage.aspx")
End If
What the Entries Collection Represents
The Entries collection contains the items the user has selected in the AutoCompleteBox. It does not
represent the suggestion list or the data source. Each entry corresponds to a user-selected token or
text item inside the control.
The AutoCompleteBoxEntry Object
Each entry in the collection is an AutoCompleteBoxEntry object. It exposes the following properties:
- Text – the visible text
- Value – the underlying value
- Attributes – optional custom fields
- IsCustom – true when the user typed a value not found in the data source
Reading Entries in Server-Side Code
You can iterate through the Entries collection during a postback or AJAX postback:
For Each entry As AutoCompleteBoxEntry In RadAutoCompleteBox1.Entries
Dim txt As String = entry.Text
Dim val As String = entry.Value
Next
Adding Entries Programmatically
Entries can be added manually when loading an existing record:
Dim e As New AutoCompleteBoxEntry("Florida", "FL")
RadAutoCompleteBox1.Entries.Add(e)
Clearing Entries
To reset the control:
RadAutoCompleteBox1.Entries.Clear()
When Entries Are Available
The Entries collection is populated only after a postback or AJAX postback. It is empty on the initial
page load. RadAjaxPanel requests behave like normal postbacks, so Entries is always available inside
those events.
Reacting to User Selections
You can respond to selections on the client or server:
Client-side:
function OnEntryAdded(sender, args) {
var entry = args.get_entry();
console.log(entry.get_text());
}