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
Post a Comment