Search This Blog

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.

Friday, April 2, 2010

[Tutorial] Check Operation System Base Type (32bit / 64bit)

Method

  1. Click Start, then click on Run or Start Search.
  2. Type msinfo32.exe and then press Enter key.
  3. In “System Information”, review the value for the System Type item:
  • For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
  • For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

reference : http://forums.techarena.in/tips-tweaks/962178.htm