Saturday, March 16, 2013

When to use Allow Unsafe Updates

AllowUnsafeUpdates is set to true when you are trying to update the database as a result of the GET request.
Say you have a list and you want to update something, then you need to set AllowUnsafeUpdates = true for the web and after you have done you need to set it back to false.
AllowUnsafeUpdates = false protects from cross site scripting.
So if you need to allow your code to make some updates, you need to set allow unsafe updates to true and then back to false as soon you update.
SPList list= web.Lists["list name"];

SPListItemCollection items= list.GetItems();

web.AllowUnsafeUpdates = true;
foreach (SPListItem item in items)
{
     item["Field"] = "new val";
     item.Update();
}
web.AllowUnsafeUpdates = false;

Also refer following links for more idea.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.allowunsafeupdates.aspx
http://blog.animesh.co.in/2010/03/sharepoint-spsiteallowunsafeupdates.html

Difference between SharePoint 2010 and 2013


Very briefly i will tell what are the major changes in SharePoint 2013 on above of 2010

First thing is it 14 hive folder has been moved to 15 hive folder and it is also called as SP15

Shredded storage this is used for storing the version updates in documents and stores locally
Workflow manager for 2013 which is also called as windows azure workflow which can be only used for SharePoint 2013
workflow service manager - this is an integration layer between SharePoint and workflow manager
workflow manager should be installed in separate farm server where SharePoint is not installed

SharePoint is now with HTML 5

content search web part(CSWP) new in SharePoint 2013

Distributed cache service which is a new service located in services on server this is used for cache in SharePoint and also used for rendering of docs more faster than previous versions

Minimal downloaded Strategy(MDS) : when a document is downloaded to SharePoint server it will create a copy locally and keep it in cache when ever changes happens it will only download the changes that are made not the whole document
MDS will not be enabled for publishing site
Enable minimal download= True is the property for enabling MDS and it is a feature in SharePoint 2013

Now using Open XML/Power point/word 2010 we can create themes in SP15 and the extension for this is .thmx

Three new services had been included in SharePoint service application:

  • Machine Translation( only this can be used across farm servers)
  • Work Management
  • App Management


Usage.xslx is an excel file in webanalytics used to see the usage of user and you can see this option in site settings--> site administration--> property trends

In SP15 webapplications are by default claims based authentication
and this calims based authentication supports

  • windows claims
  • SAML- based claims
  • Forms based authentication claims

Hosted name site collection: these site collections should have public IP and DNS examples for these site collections are
http://hr.adventure-works.com
http://it.adventure-works.com
(SP15) this is a new change in SP15

http://intranet.adventure-works.com/sites/hr
http://intranet.adventure-works.com/sites/it
(sharepont 2010) this is a old version


Saturday, January 19, 2013

How to get data from multiple lists in SharePoint

In this article I am showing you how to display data from two lists in one data view using share point designer 2007

Here I am taking the example of two list say Task and Contact list

Image1.gif



1. First of all you have to open the share point site in share point designer And then open the page where you want to insert data view.

2. Click on Insert -> Share point Controls-> Data view by selecting a web part region in your page.

Image2.gif

3. From the Right top region from the data Source Library go to Linked Source.

4. Click on Create linked source as shown below.

Image3.gif

5. Following pop up will come .From there select Configure Linked Source.

Image4.gif

6. Select the contact and Task list as shown below.

Image5.gif

7.
 Click Next. From the next screen choose Join the contents of the data sources and click Finish.

Image6.gif

8. Now you get popup as shown below Go to General Tab ad Give a proper name for our Linked source. Click OK.

Image7.gif

9. Now our linked Source will be added to Data Source list as shown below. Select Show Data.

Image8.gif

10. Now you can see the data from Two list (Contact and Task are displayed in the Linked source).

11. I have selected Phone number from Contact, Title and priority from task List.

Image9.gif

12. Now please drag the items you selected to the region where you want to display the dataview joined with two lists.

Image10.gif

13. Click save and check in your changes.

SharePoint - Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details If y...

Ad