I have a custom list ("Contacts") as well as a web part with forms. I want to take the custom list fields and map them to the web part form. My problem is getting the values from the custom list. I've tried looking through both list and field properties but I can't seem to find one that gives the value. I can get everything known to man about the value.
I know it's weird, but I'm just trying to familiarize myself.
protected void Page_Load(object sender, EventArgs e)
{
SPSite site = SPContext.Current.Site;
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists["Contacts"];
SPListItemCollection listItem = list.Items;
TextCompany.Text = listItem[0].Name;//Returns the list item title
TextFirstName.Text = listItem[0].ToString();//Returns "Microsoft.SharePoint.SPListItem"
}