Showing posts from June, 2012

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 ?

Object initializer in, 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"; = "45345345"; "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:

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