If you want a quick and easy way to get to the WebPart Maintenance Page simple append the following to the URL for any page: "?content=1". So for instance if you are at the default page your URL will look like this: http://portal.demo.com/pages/default.aspx. If you need to open the WebPart Maintenance page at this location you would add the above to the end of the URL as follows: http://portal.demo.com/pages/default.aspx?contents=1. This will open the WebPart Maintenance page for this location.
You have person or group field in SharePoint list and you want to programmatically get the user or person. The below code to gets SPUser from User or Group field in the list when multiple choice and Groups are not allowed in the field: //get SPUser SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Users"].ToString()); SPUser user = userFieldValue.User; This part of code would help you to get SPUser when multiple choice is allowed and groups are not allowed: //Multiple choices are allowed SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString()); foreach (SPFieldUserValue userFieldValue in userFieldValueCollection) { Console.WriteLine(" " + userFieldValue.User.LoginName); } And when group...
Comments
Post a Comment