Showing posts with label Sharepoint 2007. Show all posts
Showing posts with label Sharepoint 2007. Show all posts

Wednesday, October 17, 2012

Differences between SafeMode and Asp.net parser


Each .aspx page is rendered by one of two possible parsers. When a request comes for an .aspx page, sharepoint isapi filter will determine who will handle serve the request for rendering the page ASP.NET or the Sharepoint Safemode parser.

The first parser, ASP.NET, requires the least amount of introduction. The second parser is unique to Windows Sharepoint Services(WSS).

Here we need to know concept of ghosting and unghosting.

In Sharepoint some pages lies in physical folder of server i.e, _layouts or _vti_bin virtual directories. These page are accessible for across the application in sharepoint and known as ghosted pages.
And the pages which is stored in content DB and serves by the sharepoint when requested is known as unghosted page. These files are not stored in file system.

From a technical standpoint, ghosted pages are those rows in the docs table which have null values for the Content column and a non-null value for the Setup Path column which points to a file on the file system itself. The referenced file essentially serves as a template and content source.

Asp.net will parse a page on first render and compile it into an assembly. The SafeMode parser does NOT compile pages. It is designed to interpretatively parse a page and create the object structure of the page. In the event inline server-side code is detected, the SafeMode parser will not allow the page to render.

The SafeMode parser ensures unghosted pages are not allowed to run code. This security feature prevents a user from injecting code into page which may maliciously, or unintentionally, bring down a server, snoop data, etc.

SafeMode parser was designed to be serve as replacement for the Asp.net parser, it does not offer identical functionality. The key differences between the two parsers are listed below:
  • SafeMode does not offer AspCompat functionality.
  • SafeMode does not compile; therefore, all compilation   directives are ignored.
  • Session State exists; however, in SafeMode once you turn it on, all unghosted pages are forced to participate in Session State. Unghosted pages do NOT have the option to opt out of using Session State.

Monday, October 15, 2012

Sharepoint FAQ

Here are some important FAQ about sharepoint which will help you for the preparation of your interview.

All links are taken from www.dotnetfunda.com

Sharepoint Faq 1

Sharepoint Faq 2

Sharepoint Faq 3

Sharepoint Faq 4

Sharepoint Faq 5


SharePoint Articles

How to Fetch User with their permission

Some times we need to fetch the user form Sharepoint with their role and permission.

If i need to fetch all user who is having Admin Rights "Full Control" on the site.

There are two ways to achieve this. One is by using Object model and other is SQL Query on Content DB


Through Object Model

using (SPSite _Site = new SPSite("http://YourSiteName"))
        {
            using (SPWeb _Web = _Site.OpenWeb())
            {

                SPRoleDefinitionCollection roleDefinitions = _Web.RoleDefinitions;
                SPRoleDefinition roleDefinition = roleDefinitions["Full Control"];
                foreach (SPRoleAssignment roleAssigment in _Web.RoleAssignments)
                {
                    if (roleAssigment.RoleDefinitionBindings.Contains(roleDefinition))
                    {
                        SPPrincipal oPrincipal = roleAssigment.Member;
                        
                        //it can be SPUser or SPGroup, you can process and add it to the result
                         SPUser oRoleUser = (SPUser)oPrincipal;
                    }
                }
               
            }
        }

Query through Content DataBase

SELECTdbo.Webs.Id, dbo.Webs.Title, dbo.Webs.FullUrl, dbo.Roles.RoleId, dbo.Roles.Title AS RoleTitle, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_LoginFROMdbo.RoleAssignment INNER JOINdbo.RolesONdbo.RoleAssignment.SiteId = dbo.Roles.SiteIdANDdbo.RoleAssignment.RoleId = dbo.Roles.RoleIdINNER JOINdbo.WebsONdbo.Roles.SiteId = dbo.Webs.SiteIdANDdbo.Roles.WebId = dbo.Webs.IdINNER JOINdbo.UserInfoONdbo.RoleAssignment.PrincipalId = dbo.UserInfo.tp_ID AND dbo.RoleAssignment.RoleID='1073741829'

Here You need to pass the RoleID. 

Saturday, October 13, 2012

SharePoint 2007 Maximum Limitations


Following is a list of names and other parameters with the maximum allowable size on each.
Entity                                     Max Permissible Size
Site Name                               128 characters
Site URL                                  255 characters
Display name                          128 characters
Connection string                    384 characters
Email address                         128 characters
Version numbers                     064 characters
Virtual Server Friendly Name    064 characters
SQL Database Name               123 characters
SQL Database Column             128 characters
SQL Database Table Name      128 characters
SQL Role Name                      128 characters
Server Name                          128 characters
Windows User Name              300 characters
Windows Password                 300 characters
Dependencies per object         032 objects
Zone enumeration value           004 zones
Default SQL command timeout      300 seconds
Number of simultaneous
workflows that can be run*             015


If during your course of using the product, if you cross these limits, then you would end up with errors. These are the hard limits with sharepoint.