I am trying to check to see if the autocomplete box has no value before I go on in code, but the 2 methods I tried do not seem to work. I have it in single mode selection and getting the value fine but when checking for it, the code always escapes to else statement.
If txtItemSearch.Entries(0).Value = String.Empty Then
ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "alert('You must specify an administrator.');", True)
Else
Dim adminId As Integer = Convert.ToInt32(txtItemSearch.Entries(0).Value)
Dim locationId As String = ddlLocations.SelectedValue
'Dim siteAdmin As Integer = boolToInt(chkSiteAdmin.Checked)
'Dim contact As Integer = boolToInt(chkContact.Checked)
'Dim email As Integer = boolToInt(chkEmail.Checked)
If txtItemSearch.Entries.count <
0
Then
ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "alert('You must specify an administrator.');", True)
Else
Dim adminId As
Integer
=
Convert
.ToInt32(txtItemSearch.Entries(0).Value)
Dim locationId As
String
=
ddlLocations
.SelectedValue
'Dim siteAdmin As
Integer
=
boolToInt
(chkSiteAdmin.Checked)
'Dim contact As
Integer
=
boolToInt
(chkContact.Checked)
'Dim email As
Integer
=
boolToInt
(chkEmail.Checked)
<div
class
=
"div100"
>
<
telerik:RadAutoCompleteBox
ID
=
"txtItemSearch"
runat
=
"server"
Width
=
"260px"
OnClientRequesting
=
"requesting"
AllowCustomEntry
=
"false"
DropDownPosition
=
"Automatic"
CssClass
=
"centAutocomplete"
EmptyMessage
=
"Enter Last Name First Name to Search"
InputType
=
"Text"
HighlightFirstMatch
=
"true"
TextSettings-SelectionMode
=
"Single"
DropDownWidth
=
"250px"
>
<
WebServiceSettings
path
=
"../AutoComplete.asmx"
Method
=
"FindAdmin"
/>
</
telerik:RadAutoCompleteBox
>
<
asp:HiddenField
ID
=
"HFAdminId"
runat
=
"server"
/>
</
div
>