Search This Blog

Thursday, August 26, 2010

[Tutorial] Hide "Site Actions" for the anonymous users (SPSecurityTrimmedControl)

It uses to hide the SiteActions button based on the permission set. I tried it with hide html table for that control, it’s work to me ! So no problem SiteAction is inside a styled table.

<SharePoint:SPSecurityTrimmedControl ID = "spstcSiteActions" runat = "server" PermissionsString = "ManageWeb" >

……………

</SharePoint:SPSecurityTrimmedControl>


List Permissions

ManageLists
CancelCheckout
AddListItems
EditListItems
DeleteListItems
ViewListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CreateAlerts
ViewFormPages

Site Permissions

ManagePermissions
ViewUsageData
ManageSubwebs
ManageWeb
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
CreateGroups
BrowseDirectories
CreateSSCSite
ViewPages
EnumeratePermissions
BrowseUserInfo
ManageAlerts
UseRemoteAPIs
UseClientIntegration
Open
EditMyUserInfo

Personal Permisions

ManagePersonalViews
AddDelPrivateWebParts
UpdatePersonalWebParts

reference : Hide "Site Actions" for the anonymous users (The easy way)

Thursday, July 22, 2010

[Tutorial] Enable Server Side Code in SharePoint Page Layout using SP Designer

If you use the Microsoft Office SharePoint Designer to add a new page to your site, you will see that it looks just like any other ASP.NET page. Open up your site with the SharePoint Designer, and then go to the Pages folder. Right-click the Pages folder and choose New / ASPX. That will generate a new ASP.NET page with the following default template:

1. Add following code-block to Web.Config, it should be locate in C:\Inetpub\wwwroot\wss\VirtualDirectories\<site>\Web.Config

<PageParserPaths>
  <PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>

2. Open the page layout that you going to add in server side code by using SharePoint designer.  It does how you do scripting like other way… and put your coding such as c# into it. like following :

<script runat="server">
protected void Page_Load(object sender, EventArgs e)

Response.Write(“Hello World !”);
}

</script>

3. Done. Happy Coding. ;-)

[reference] : http://blogs.msdn.com/b/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx

Wednesday, May 12, 2010

[Tip] SharePoint Unknown Error

i have been told about this on how to work out this error…Here again just a reminder to myself

  1. Locate this file … c:\inetpub\wwwroot\wss\virtualdirectories\<mysitename>\web.config
  2. Search for “CallStack” and toggle that element to “true”. Then, do a search for “customErrors” and toggle that element to “off”.
  3. Save the web.config file.