Sitecore how to get a Droplist or Droplink selected item's both Id and Value?

856 Views Asked by At
var item = Sitecore.Context.Database.GetItem('xxx'); 

Now how can I get both its id and value? I've tried use item.Fields[""] , but only got an empty string, not sure why.

1

There are 1 best solutions below

0
Vaishali Raghuvanshi On

What Sitecore field type you are using "Droplink" or "DropList".

Please see if below solution helps:

How to access the selected item in a Droplist in Code Behind?