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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -