sharepoint object modelling -


protected void btncreatelist_click(object sender, eventargs e) {     spweb currentweb = spcontext.current.web;      guid webid = currentweb.id;      guid siteid = currentweb.site.id;     response.write(siteid);      spsecurity.runwithelevatedprivileges(delegate()     {         using (spsite site = new spsite(siteid))         {             using (spweb web = site.openweb(webid))             {                 site.allowunsafeupdates = true;                 response.write("configured successfully");                }         }     });    } 

you running code outside sharepoint, or before spcontext initialized (http handler, example).


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -