Subscribe
E-mail
Download View Codeplex Project Site
Powered by: newtelligence dasBlog 1.9.7174.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Rich Finn
dasBlog MOSS template
Update 10/8/2007 - This code is obsolete, as the SPFieldLookupValue object is a much better way to go
Here's some code that I use to get values out of a field in a SharePoint 2007 list since the id is sometimes imbedded into the value.
public static string ListValue(object listValue) { string[] splitter = new string[1]; splitter[0] = ";#"; if (listValue != null && listValue != string.Empty) { string[] checkListValue = listValue.ToString().Split(splitter, StringSplitOptions.RemoveEmptyEntries); if (checkListValue.Length > 1) return checkListValue[1]; else return checkListValue[0]; } else { return string.Empty; } }