What is the difference between data text field and data value field properties of drop down list

Posted by Sekar.C under ASP.NET on 5/22/2012 | Points: 10 | Views : 29291 | Status : [Member] | Replies : 2
Hi,
What is the difference between data text field and data value field properties of drop down list

Regards
Sekar.c



Responses

Posted by: Chakram on: 5/22/2012 [Member] Starter | Points: 25

Up
0
Down
DataTextField is the one what it will be displayed in dropdownlist and DataValueField is what value you will get on selection in code that we may require to implement some bussiness logic

Use the DataTextField and DataValueField properties to specify which field in the data source to bind to the Text and Value properties of each list item in the control, respectively.


Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 5/23/2012 [Member] Starter | Points: 25

Up
0
Down
Use the DataTextField property to specify which field from the DataSource to bind to the Text property of each item in the control.

This differs from the DataValueField property, which is used to specify the field that will provide the Value of each select option. DataTextField provides the selectable options that the user interacts with, while DataValueField provides the values that are used when submitting the form data.

regards

sriram

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response