Scenario:
You want to set the Field properties programatically
Code:
using(SPSite siteColl = new SPSite("http://localhost/testsite")){Article:
using(SPWeb web = siteColl.OpenWeb()){
site.AllowUnsafeUpdates = true ;
SPList list = web.Lists["Tasks"];
SPField field = list.Fields["Title"];
field.Description = "This is the title";
field.Update(true);
list.Update();
web.AllowUnsafeUpdates = false ;
}
}
0 comments:
Post a Comment