Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating A Drop dropdownlist 1

Status
Not open for further replies.

dhmfh

Programmer
Nov 28, 2005
69
GB
Hi guys,

I have the following function that loads a drop down list from the db and then I am inserting a new value as the default. Could someone guide me to the best solution to validate the drop down so that they select a value

Protected Sub s3selcustomertitle_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles s3selcustomertitle.Load
'This Will DataBind The Payment Type Drop Down Control
If Not Me.Page.IsPostBack Then

s3selcustomertitle.DataSource = DataLoad.CustomerTitles
s3selcustomertitle.AutoPostBack = False
s3selcustomertitle.DataValueField = "CustomerTitle_Id"
s3selcustomertitle.DataTextField = "CustomerTitle_Name"
s3selcustomertitle.DataBind()

s3selcustomertitle.Items.Insert(0, "Select A Title ...")

End If
End Sub
 
Check the SelectedItem property of the DropDownList to see what the user has selected.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top