SPWeb.EnsureUser()注意AllowUnsafeUpdates=true
使用时一直报异常,后仔细看它的定义
SPWeb.EnsureUser       
方法 (Microsoft.SharePoint)
Checks whether the specified login name belongs to a valid user of the Web    
site, and if the login name does not already exist, adds it to the Web site. 
它会对SPWeb进行更改操作,那么SPWeb.AllowUnsafeUpdates = true;就是免不了的了
 
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号