DropDownListBox: I want to 'limit to list'

J

julie6232000

I don't want the users to type in any new items but select only what is
on the list.

Here's my code to load the ASP:DropDownList:

'----------------------------------------------------------------------------
'-- ADD ITEMS TO THE TYPE DROP DOWN BOX

'----------------------------------------------------------------------------
sqlCMD.Connection = New
SqlConnection(ConfigurationSettings.AppSettings("con"))
sqlCMD.CommandType = CommandType.StoredProcedure
sqlCMD.CommandText = "usp_GetAppType"

sqlCMD.Connection.Open()
myReader = sqlCMD.ExecuteReader()

If myReader.HasRows Then
'Add blank first item. Note this will be the default
selection but user must select another value
Me.ddlType.Items.Add("")
Do While myReader.Read()
i = New ListItem(myReader.GetString(0))
Me.ddlType.Items.Add(i)
Loop
Else
i = New ListItem("No items returned")
Me.ddlType.Items.Add(i)
End If

myReader.Close()
sqlCMD.Connection.Close()

'Remove ALL from the type of application drop down list
Me.ddlType.Items.Remove("ALL")
Me.ddlType.SelectedIndex = 0
 
J

julie6232000

Ok when I take the application and database home and recomplie and run
it there, I can not enter any text in the drop down list control.
We'll be rebuilding our web server later today. I know that doesn't
tell me the problem, it should correct it.

Thanks everyone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top