SPWeb is a single website in SharePoint residing in a Site Collection (SPSite).
0
votes
0answers
32 views
SPWeb.GetFolder() returns SPFolder with no files or sub folders
I'm encountering a strange problem on SharePoint 2007 where the following script correctly enumerates files and folders on my QA and DEV sites, but not on my Production site. Why is SPWeb.GetFolder() ...
1
vote
1answer
352 views
Is it possible to copy SP Web from 2010 to 2013?
All I am trying to do is copy a SharePoint Web (i.e: http://sp2010/hr) to (i.e: http://sp2013/hr).
I was able to export using:
Export-SPWeb http://sp2010/hr –Path "hrexport.cmp"
But when I try to ...
0
votes
2answers
463 views
Is it possible to determine if a given URL represents an SPListItem?
I am wondering if there is some sort of way to check a URL to see if it represents a list item before calling SPWeb.GetListItem that I haven't found.
I have code that needs to retrieve a list item ...
4
votes
3answers
3k views
How to run with elevated privileges in application page?
I want to get a list item that the current user does not have access to but I need to get it in code. When I use SPSecurity.RunWithElevatedPrivileges that does not work.
It's because I'm using the ...
1
vote
3answers
69 views
How to get all SPWebs using visual studio?
I want to get all webs including it's subwebs.
Eg.
Site
web1
subweb1
subweb2
web2
How to achieve ?
1
vote
2answers
52 views
Getting the logged in user given the SPWeb, regardless of elevated priveleges
I have a requirement to be able to always get the logged in user.
The object the calling process is going to pass is the spweb.
As this is legacy code, I cannot change what the calling processes ...
0
votes
0answers
24 views
SPWeb approvers. Different users for each SPWeb in a site collection
I have created a custom site collection and in this site collection are multiple SPWeb news sites.
The news SPWebs are moderated by different groups of users. I want to create a group for each news ...
0
votes
2answers
68 views
How to properly dispose of sp 2007 object in powershell?
First and foremost I've done A LOT of googling and even went past the first page or 2 :) so feel free to direct me to the proper post if necessary.
I am trying to loop through a bunch of webs and ...
1
vote
1answer
58 views
Changign language in sharepoint programattically
Hey every one i am having some problem in changing the language in sharepoint programattically i am having two language packs installed on my server norwegian and english if am changing language ...
0
votes
4answers
895 views
Detected use of SPRequest for previously closed SPWeb object after SPQuery
this code run yesterday very well and today I've been trying to solve this error for hour now :
Please close SPWeb objects when you are done with all objects obtained from them, but not before
I ...
1
vote
1answer
707 views
Adding SPListItem using SPWeb.ProcessBatchData method
I am looking for adding SPListItem using SPWeb.ProcessBatchData method. Could any one please help me on syntax for adding list item to my custom list.
0
votes
1answer
146 views
Get N Number of subwebs for specified web
How to get All Subwebs upto N Levels for Specified Web.
eg.
My Site url is...
"http://server/web1"
I need all subwebs upto N Levels for web1..
below line get all subwebs upto N Levels of ...
4
votes
2answers
86 views
best way to store property of a site
I have a site called Exhibitions that contains many many subsites each of which is an individual exhibition (with pages, images etc). I would like to attach to each of these subsites a property which ...
4
votes
4answers
5k views
How can I get a reference to a specifc SPWeb object in a custom timer job?
I have a custom timer job that imports data from an external source into a specific list on a specific Web in my SharePoint 2010 installation. That is the job is only relevant to one list on one web. ...
0
votes
2answers
130 views
SP2010 Update Site Title and Description - Security problem
I've created a custom application page to update the Title and Description of a site.
The page is generating an access denied and the following error message in the log file:
Unknown SPRequest ...
0
votes
0answers
34 views
Any ideas why the Inherit is not available on a SPWeb?
Any ideas why the Inherit is not available on a SPWeb?
1
vote
1answer
403 views
Getting SPWeb in feature receiver
While testing my solution I receive an error on Feature activation:
Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects ...
1
vote
1answer
125 views
joining absolute and relative URLs of sharepoint in <a href> anchor tag
I want to join absolute and relative URL parts of a sharepoint site in <a href="http://somesite"> tag.
i already have this:
strng.Format(@"<a ...
0
votes
1answer
227 views
Check if SPUser has access to an SPWeb object without causing an Access Denied redirect
As part of a Workflow Association Form code-behind we need to access information on different sites (in the same site collection). It is possible that the user trying to configure a workflow does not ...
1
vote
2answers
112 views
Add script reference to all pages in a site collection when a feature is activated
I'd like to have a feature which adds a script reference to all pages in a site collection when activated.
This seems like a scenario where I should just modify the master page, but for it to affect ...
2
votes
2answers
146 views
SPSite.RootWeb.AllProperties is null Claims Authentication
I just created a new WebApplication & Site Collection in sharepoint.
Note : WebApplication uses Claims Authentication mode, Custom Trusted Identity Provider for my application.
In powershell ...
1
vote
3answers
58 views
Is using the Using statement to close unknown and possibly Current webs, bad practice?
Until today I had been using the Using statement to open and dispose of webs.
The variable relative_web_url is defined by a user input in the custom web part editor.
using (SPWeb web = ...
0
votes
3answers
231 views
Getting SPWeb Object in two ways
I want to access SPWeb object in feature under its FeatureActivated method. There are two ways to do this:
Public Override void FeatureActivated(SPFeatureReceiverProperties properties)
{
//Method 1
...
1
vote
1answer
165 views
WebProvisioned Event Is Not Firing When Creating SPWebs Programmatically
I have a WebProvisioned event receiver and i do some work in this event receiver. When i create new webs from a console application programmatically, it seems the event receiver does not fire? Is this ...
0
votes
2answers
100 views
How check if a site (not site collection) has sub sites in it? [Object Model]
I am trying to figure out a way to check if a Site inside a Site Collection has sub sites in it.
To get sites inside a site collection, we can use the below code.
foreach (SPWeb siteobject in ...
0
votes
1answer
125 views
Creating New-SPWeb from PowerShell & WebProvisioned Event Receiver?
I have a WebProvisioned event receiver and i do some work in this event receiver. When i create new webs from powershell, it seems the event receiver does not fire? Is this an expected situation? How ...
1
vote
0answers
172 views
_spBodyOnLoadFunctionNames.push Not working in firefox
I tried this in firefox i dont know why its not working but it working in other browsers
function loadmonth() {
alert('called');
}
_spBodyOnLoadFunctionNames.push("loadmonth");
0
votes
0answers
73 views
spquery.query cannot be charged correctly
I'm charging my spquery with different parameters from a static class called Fields :
In fact I'm using this query to bind result data to my asp:grid view
using (SPSite mySite = new ...
6
votes
3answers
3k views
Detected use of SPRequest for previously closed SPWeb object within workflow
I have a visual studio sequential workflow. In that workflow, I have a string property called AllowDisposition. When the workflow starts, I populate that value by doing workflowProperties.Item["FIELD ...
0
votes
1answer
53 views
SPLink.UrlParameter
Is there a way to assign value to Microsoft.SharePoint.SPLink.UrlParameter. From MSDN, I see that this is parameter is read only, but was wondering is there any setter function that would have access ...
0
votes
1answer
398 views
SPWeb.RegionalSettings.TimeZones
Apparently each SPWeb can have it's own list of TimeZones (assuming that is why there is a TimeZones property on each SPWeb's RegionalSettings).
Why could/would a web/site within a site ...
3
votes
4answers
1k views
Get SPWeb by ID without Site Collection?
I have a list of SPWeb IDs and would like to open the associated SPWeb objects. However, I do not know in which Site Collection they are (I DO know that they are in the current Web Application ...
0
votes
4answers
258 views
Safely return all lists in site collection that match criteria
I'm using the following code to get all "Announcement" lists in a Web Applications site collection.
Unfortunately, sometimes the current user does not have permission to that site and the page fails ...
0
votes
2answers
287 views
Best way to get all subsites
I want to create a list of all subsites (all levels), and some details about each of them.
The simplest way is to do a recursive function, but I have many subsite (about 600) and I want a more ...
0
votes
1answer
82 views
Multilingual User Interface (MUI) not works with SiteTemplates
I've created a CType and create columns namings for multiple languages by changing the current language and set the corresponding naming. Then I create a Subsite (same language based) using those same ...
0
votes
2answers
481 views
Get all SPLists for a site collection
I feel like I'm very close on this one.
I know how to get the root site collection from this:
How can I get the root site collection from SPContext.Current?
I've been messing around with ...
0
votes
2answers
72 views
How to find if a SPWeb is search site?
I want to check SPWeb reference if it is a search site. How can i do this by code.
Thank you
0
votes
0answers
102 views
Content Typed Field Names not propagated with Multilingual User Interface (MUI)
I've created a CType with columns namings for the alternated languages, by changing the current language and set the corresponding naming. So far so good, it works as expected.
The problem comes when ...
0
votes
1answer
477 views
“Detected use of SPRequest for previously closed SPWeb object” within Event receiver but no error when run in test harness
I have a very strange issue which I cannot explain. We have and event receiver and within this we instantiate our own class that does all the work we need it to do. As part of this we pass in an SPWEB ...
0
votes
1answer
734 views
Get all document libraries from a site URL
I'm trying to build a WPF application in which the user specifies the URL in a textbox and after clicking "Connect" the app will fill a Combobox with a list of SharePoint Document Libraries. I'm ...
0
votes
1answer
227 views
Dispose SPWeb object in recursive function
I have updated my code as per suggestions from suggestions on my earlier question , I still see the error message for one of my recursive function.
Below is the code snippet to recursively loop ...
0
votes
3answers
279 views
SPSite and SPWeb object dispose inside foreach loop
I have a code that loops through all the Sites and Webs in a web application. My code uses for..each loop to navigate through each site and web object.
I was wondering if we are required to dispose ...
0
votes
2answers
373 views
EnsureUser not working in Job
Background:
sharepoint 2010
custom membership provider
custom job to create users
Job is deployed by code and executed first time from some WinForms exe, executed by local Administrator. Users are ...
0
votes
1answer
196 views
Effectively Querying Subsite RootFolder.Properties
I'm storing some data in the RootFolder.Properties for a bunch of subsites, sub-subsites and sub-sub-subsites. On the parent site(s), I want to roll up that data, security trimmed for the user. (All ...
0
votes
2answers
52 views
How do I figure out if I have permissions to use site.openWebs without changing code?
I have been newly assigned to a client and I am trying to run an existing console app to get some information about files within their sharepoint instance.
The code goes something like this:
//Enter ...
2
votes
3answers
463 views
Error using current SPWeb from HttpModule
Is it allowed to access SPWeb and specifically SPWeb.ID from PreRequestHandlerExecute ?
Writing an HttpModule [SharePoint2010] and trying to access current web ID using this line of code :
private ...
1
vote
1answer
842 views
c# iterating SPWeb.Navigation.GlobalNodes
When I try to iterate through the GlobalNodes collection using c# it is always empty unless I the site and manipulate the navigation settings manually.
Can anyone tell me why this is and/or give an ...
3
votes
1answer
148 views
Disposing of SPWeb object query
I'm trying to understanding the object clean up process.
using (SPSite siteCollection = new SPSite(siteUrl))
{
SPWeb site = siteCollection.RootWeb;
foreach (SPList list in site.Lists)
{
if ...
2
votes
4answers
354 views
What are the dangers of disposing of SPWeb when it's automatically disposed of?
In some cases such as:
using (SPSite site = new SPSite(@"http://sitecollection/"))
{
SPWeb web = site.RootWeb;
}
you don't need to dispose of the SPWeb object because it is disposed of ...
1
vote
1answer
217 views
Get all webs with certain property value
If I have a certain number of webs within my site collection, and those web have set some property, eg. web.Properties["foo"] = "bar". I'd like to get list of all the webs which have property foo set ...





