Monday, 15 June 2009

Helpful class to get Display and Internal Field names for a SPList

namespace ConsoleApplication1

{

public class FieldList

{

/// <summary>

/// Shows the Display field and internal field name for a list.

/// </summary>

/// <param name="litem"></param>

public static void ShowFields(SPListItem litem)

{

for (int i = 0; i < litem.Fields.Count; i++)

{

SPField field = litem.Fields[i];

Console.WriteLine(field.Title + "(" + field.InternalName + ")");

}

}

 

 

}

}

 

No comments:

Post a Comment