When I'm testing some SharePoint menu customization with inline server scripts in the page layout. The test page applied this page layout cannot be visited because of following error message.
Code blocks are not allowed in this file
After a quick search on the Internet, this error is due to the default security settings which disable the inline server scripts running in SharePoint. To turn it off, we have to change the PageParserPaths settings in web application's web.config file like below:
<PageParserPath VirtualPath="/yoursite/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" />
As we know there are several web.config files in different locations for SharePoint . Here is official list of all web.config files:
http://msdn.microsoft.com/en-us/library/ms460914.aspx
What we need to modify is the content web application's config file in the following directory:
\\Inetpub\wwwroot\wss\VirtualDirectories\ Port_Number
Monday, May 30, 2011
Thursday, November 18, 2010
SharePoint wss_content log file keeps growing
The another day I received a request to check an issue with our production SharePoint Server 2010. The user could not save edited documents or upload documents to the library. Different error messages pop up. After further investigation, we found that the SharePoint database server is running out of disk space. The database file check showed that the largest data base is the wss_content (Of course, it's the SharePoint content DB). Surprisingly, the log file wss_content.ldf had triple size of wss_content.mdf.
So we backed up the log file and then shrink the log file to get back lots of space. Then the problem was gone. Meanwhile, we limited the wss_content.ldf to a fixed size to avoid this growth.
However, one month later, the problem reoccurs again. And if you check the serer log, you will find following error
Unknown SQL Exception 9002 occurred. Additional error information from SQL Server is included below.
The transaction log for database 'WSS_Content' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

We have to repeat the log backup to get back space. At the same time, we do more check on the database recovery mode configuration and find it's "Full" mode, that means, the log file will keep growing and once it's up to the throttle, it will require the log backup. This is mandatory task because the "Full Recovery Mode" means, you can recover your database to an arbitrary point in time, which is based on the transactions in the database log file.
So if you don't want this point-to-time recovery possibility (maybe you already has backup plane for your database), you can just switch back the content db recovery mode to "Simple".
More information about More information of SQL Server, you can find here:
Recovery Model Overview
Thursday, November 11, 2010
Create shortcut link for adding Alert in Sharepoint 2010
In out-of-box blog template of SharePoint 2010, if we want to set up alert for the blog, we have to go to all site content -> lists -> post and then use the Alert ribbon in the List tab. Or if you are blog contributor, you can click on the quick like "manage posts" to switch to the posts list and then do the Alert setting. Neither of these is straightforward enough.
If we want to add shortcut for adding Alert for this blog, how are we going to do this?
Actually, SharePoint 2010 has centralized Alert management feature and there is a subscription page for every site in the farm. The page path should be similar with this one:
http://woss01/blog/_layouts/SubNew.aspx
As we see, it's under site "_layouts" folder. And it does support the "List" QueryString parameter so that we can pass the List GUID to set up alert for specific list.
To check what's the GUID for your list, we can always go to the list settings page. Right click on "Title, description and navigation" and copy the URL. Paste that into notepad and copy everything after "List=" in the string. That's your URL Encoded GUID for the list.
Once we identify the list URL Encoded GUID, here is the quick link of adding alert for this list:
If we want to add shortcut for adding Alert for this blog, how are we going to do this?
Actually, SharePoint 2010 has centralized Alert management feature and there is a subscription page for every site in the farm. The page path should be similar with this one:
http://woss01/blog/_layouts/SubNew.aspx
As we see, it's under site "_layouts" folder. And it does support the "List" QueryString parameter so that we can pass the List GUID to set up alert for specific list.
To check what's the GUID for your list, we can always go to the list settings page. Right click on "Title, description and navigation" and copy the URL. Paste that into notepad and copy everything after "List=" in the string. That's your URL Encoded GUID for the list.
Once we identify the list URL Encoded GUID, here is the quick link of adding alert for this list:
Tuesday, September 28, 2010
Filter settings of Sharepoint view based on Approval status
Today I’m trying to create a view for clients with workflow enabled for a list. It comes up with this needs that filter the list based on “Approval Status”. Actually, we can find the “List Name Approval” from the Filter definition block for the view like below.
However, when we try to use “Approved/Pending/Rejected” as the “is equal to” value. It doesn’t work. I check the SDK and here is the definition of SPWorkflowStatus:
It’s still not matching the “Approval Status” in the list we use. However it does imply that the filter of “Approval Status” should be working based on enumeration integer value, rather than status string value.
A further research on MSDN forum, from the discussion of thread below:
Here are the integer values for Approval Status:
Rejected = 17
Approved = 16
Canceled = 15
As it states, this is coming from source code of “Approval Workflow Sample” in MOSS SDK. If you want to get a full list of “Approval Status” integer value list, here it is (from SharepointKB.org):
0 - Starting
1 - Failed on Start
2 - In Progress
3 - Error Occurred
4 - Canceled
5 - Completed
6 - Failed on Start (retrying)
7 - Error Occurred (retrying
15 - Canceled
16 - Approved
17 - Rejected
Hope it helps.
Subscribe to:
Posts (Atom)

