Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. What's the purpose of datavaluefield and datatextfield

What's the purpose of datavaluefield and datatextfield

Scheduled Pinned Locked Moved ASP.NET
toolstutorialquestionannouncementlounge
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amittinku
    wrote on last edited by
    #1

    I have observed that for dropdown, we have to use either DataValueField or DataTextField or both. Without these, values are not visible in dropdown. Still confusing wWhat's the purpose of DataValueField and DataTextField? Why to use and which to use when? As per my undertstanding: DataValueField: for Backend DataTextField: for front end But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField. SO any good example to show their diff as well as utility?

    C 1 Reply Last reply
    0
    • A amittinku

      I have observed that for dropdown, we have to use either DataValueField or DataTextField or both. Without these, values are not visible in dropdown. Still confusing wWhat's the purpose of DataValueField and DataTextField? Why to use and which to use when? As per my undertstanding: DataValueField: for Backend DataTextField: for front end But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField. SO any good example to show their diff as well as utility?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      amittinku wrote:

      DataValueField: for Backend DataTextField: for front end

      Correct.

      amittinku wrote:

      But in general scenarios, whatever we display in dropdown using DataTextField, we will update/delete etc the same at backend using smae colum in DataValueField.

      Sometimes. It's often possible that you would, for example, show a list of employee names. Odds are, you'd prefer to look them up in the database using an employee id. That's what the value field is for.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups