Posts

Showing posts from 2012

What is sandbox solution in SharePoint?Please explain

Sandbox solution is a new feature in sharepoint 2010. As sharepoint is a server component, so instead of giving full access on farm to a site collection administration sandbox will give a limited access of the developed code.

In SharePoint 2007 only a farm administrator can deploy or install solutions to SharePoint site. But in SharePoint 2010 a user with site collection administrator permission itself can deploy the solutions. This feature of SharePoint 2010 reduces the dependency on farm administrator. A sandbox solution is a custom code solution which runs in a different sandbox. You can say that sandbox solutions run in a different process while others run in respective SharePoint process.
Why sandbox was introduced by SharePoint?
Now a question may arise that why a SharePoint developer need sandbox solutions or what is the purpose of sandbox solution.
The reason for it is this is pretty simple to do some code in visual studio and deploy it in SharePoint site, of course if you ha…

How to solve this error "A potentially dangerous Request.Form value was detected from the client"

If you are using .net3.5 or lower version then put this line in web.config

<pages validaterequest="false">
under <system .web="">....</system>

Object initializers and Collection initializers in asp.net ?

Object initializer in asp.net, C#.net 4.0 features.

Object initializers is one of the most important feature of C # 3.0.
What is Object initializers?
Using Object initializers we can initialize a object of that type without explicitly invoking the constructor of that particular type.

Object initializers:
I will explain this with a piece of code:
class Student
{
    public string Name { get; set; }
    public string phone{ get; set; }
    public string city{ get; set; }
 }
Now see the differences:
In C#2.0 we were doing like this:
Student objStudent = new Student();
objStudent.Name = "Chevrolet Corvette";
objStudent.phone = "45345345";
objStudent.city= "New Delhi";

But in C# 3.0 we can use the same thing like this:
Student objStudent = new Student { Name = "Jhon", phone = "4543432", city = "New Delhi" };

This is because of object initializers feature of C# 3.0.

Now we will see Collection Initializers:

In C# 3.0 we can do the collect…

What are types of pages in sharePoint ? Explain the concept of ghosting and unghosting

All sites in SharePoint are the collection of web pages. There are 2 types of concept in paging. Ghosting and unghosting.

SharePoint pages from 2 places on are from database or another one from disk i.e. from virtual path.
Ideally the output will be combination of these both.
The pages available in SharePoint:
 Application pages: These are pages loaded from disk.  Application pages can be found in Layout folder of hive folder in SharePoint.
Site Pages:  These pages loaded from content database. All those content generated by users are represent through site pages.
There are types of site pages which include:
Web part Pages: A web part page will allow a user to add web parts.
The other type of site page includes Master Pages.
Concept of Ghosting and Unghosting:
As we know that SharePoint offers 2 types of pages i.e. Application pages and site pages.
When a page is customized in SharePoint designer then for that page all the future exposure will be done from content database. So this pr…