Questions tagged [spweb]

SPWeb is a single website in SharePoint residing in a Site Collection (SPSite).

162 questions
5
votes
1 answer

How can i get name of the site definition configuration or site template from SPWeb?

I know that SPWeb have "WebTemplate" property and it always gives me string like "STS" or "MPS", but what I need is something like "STS#1". There is also "WebTemplateId" property, it gives WebTemplate Enumeration, which isn't useful for me.
Dmitriy Inozemtsev
  • 523
  • 10
  • 19
3
votes
3 answers

List of all users having access to at least one site in the site collection

I want to retrieve all the users who are having any access to at least one site in a site collection. I tried using 'SPWeb.SiteUsers' and it gave me almost what i wanted. The only exception was - it also returns me the users which once had…
Amit Tyagi
  • 901
  • 2
  • 19
  • 34
2
votes
2 answers

When should I set the AllowUnsafeUpdates property?

It mentioned that we should set "AllowUnsafeUpdates" to true, when the web object is not created from the SPContext. However should I still need to set as mentioned below? SPWeb web = SPContext.Current.Web; web.AllowUnsafeUpdates = true; //…
Karthikeyan
  • 2,548
  • 14
  • 82
  • 142
1
vote
1 answer

Printing out contents

how can I print out $user["EMail"] from below code snippet cls $web =Get-SPWeb http://wer.com/sites/wooly/ $list=$web.Lists["User Information List"] $user =$list.GetItemById(##) $user["EMail"].print()????????????????????? I tried…
Zarko
  • 23
  • 1
  • 4
1
vote
2 answers

Changing language programmatically

I am having some problems in changing the language in SharePoint programmatically. I have two language packs installed on my server (Norwegian and English). If I change the language manually through the GUI then its changing but when I do it…
Pathfinder
  • 11
  • 1
  • 2
1
vote
2 answers

How to check if a subweb exists within a web

How can i check if a subweb exists among SPWeb.Webs ? If i try web.Webs["SubWeb"] it will rise an exception. Is the following solution clean ? SPWeb webfound= null; foreach (SPWeb subweb in web.Webs) if (subweb.Title == "SubWebTitle") { …
Ythio Csi
  • 185
  • 1
  • 9
0
votes
2 answers

Battling to get SPWeb, Sharepoint 2010 Object Model.

I have the following URL to a subsite : http://myServerName/subSiteName I know the URL to the subsite upfront. So far I'm trying this, but it won't work. using (SPSite spSite = new SPSite(this.siteURL)) { using (SPWeb spWeb =…
user879
  • 1,066
  • 6
  • 23
  • 47
0
votes
2 answers

Is it okay to keep an SPWeb object alive longer than its httprequest?

Scenario (note this is hand written dummy code - might not work :) public class MySuperClass { private static Dictionary _instances = new Dictionary private SPWeb _contextWeb; private…
lapsus
  • 467
  • 1
  • 7
  • 14
0
votes
0 answers

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 web called 'News Owners' and in each web assign…
Ralph W
  • 988
  • 8
  • 15
0
votes
1 answer

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 to this variable.
0
votes
1 answer

Page title cannot be set

Cannot set programmatically the title of my SP page - i mean to the SPWeb object: web.Title = "..."; web.Update(); The changes are set only after one more refresh of the page. But i need the correct title text on the first load.. When i tried to…
Natan Kara
  • 11
  • 3
0
votes
1 answer

How to use the AllowUnsafeUpdates on the LayoutsPageBase in SharePoint 2013?

I am trying create an application page and want to make sure that AllowUnsafeUpdates property is properly used. Please suggest me the proper usage of AllowunsafeUpdates from the following code. I have two textbox and would be updating two Items from…
Karthikeyan
  • 2,548
  • 14
  • 82
  • 142
0
votes
1 answer

Question on SP 2013 calculation

reguarding this questiong How do i Generate different calculations depending on what item is selected in drop down box? How would I do this calculation? while the calculation for ISDN is = ((len_26 + bt_26 + dlen_26 + dbt_26) * 2.81) + ((len_24 +…
Matt Ludwig
  • 543
  • 7
  • 14
  • 26