Using runwithelivatedprivilages and using delegates

SPSecurity.RunWithElevatedPrivileges(delegate()  
         {  
             using (SPSite site = new SPSite(SPContext.Current.Site.Url))  
             {  
                 using (SPWeb web = site.OpenWeb())  
                 {  
                     SPList LstPicture = web.Lists["......"];  
                         
                     foreach (SPListItem item in LstPicture.Items)    
                     {  
                              
                         LstPicture .Add(textbox.text);  
                     }  LstPicture .update();     
                                      }  
             }  
         });  
 }  

Comments

Popular posts from this blog

SPSiteDataQuery to get data from multiple lists in site collection level in sharepoint 2013

Some of the Share Point Object Which I Practiced Till Now

Get List items using Camel Query with REST API SharePoint