How to use the SharePoint Web Controls – Update

How to use the SharePoint Web Controls – Update

My post How to use the SharePoint Web Controls has been updated.

It now shows how to use a generic control for each SPField, instead of picking the corresponding SharePoint Web Control.

   1:  BaseFieldControl webControl = field.FieldRenderingControl; 
   2:  webControl.ListId = list.ID; 
   3:  webControl.ItemId = item.ID; 
   4:  webControl.FieldName = field.Title;
   5:  webControl.ID = GetControlID(field);
   6:  webControl.ControlMode = mode;

Thanks for all the great comments and ideas!

Leave a Reply