Monday, June 17, 2013

Get data from People Picker(ClientPeoplePicker) through code

There is a new control in sharepoint 2013 named ClientPeoplePicker.Which is a very good control loads the user prediction on the client side using a hidden div .


To get the data from this control on the server side use the code below


string a = "";

ArrayList resolve = pepPickcker.ResolvedEntities;
foreach (PickerEntity entity in resolve){
a += entity.Key+";";   //Key will give you the login name you can use other attributes}


*pepPickcker is the control ID


Friday, June 14, 2013

Get the details of features in sitecollection in sharepoint

open the Sharepoint management shell and use the code

Get-SPSite hhtp://yoursitecollection | Get-SPWeb -Limit ALL | %{ Get-SPFeature -Web $_ } | Sort DisplayName -Unique | FT DisplayName,Id

Monday, June 10, 2013

Multilingual markups in aspx pages

You can use the below tag to have a multilingual texts in aspx pages

Text="<%$Resources:testresourcefile, lbltest; %>"

Where testresourcefile is the default resource file name and lbltest is a key in all the resource files .

you got to have Resource files

  •  testresourcefile.resx
  • testresourcefile.en-US.resx
  • testresourcefile.de-DE.resx
  • etc
in Mappaed foledr called "RESOURCES" in your visual studio project.



for other multinguals

Infopath forms
Visual Webparts
Site columns,Content types and lists

Wednesday, June 5, 2013

Create Multilingual Sharepoint Site Columns,Content types and Lists from Visual studio programatically




·         Create resource file Eg: test.resx ; test.en-US.resx for English and  test.de-DE.resx for German
·         Add the key values Eg: Stringtest = Documan
·         Create site columns
·         Change the display name of site columns in element.xml as DisplayName="$Resources:Stringtest" Note:Stringtest should be in all the above resource files.
·         Now since your site columns are create in multilingual.
·         Create content type using these columns.
·         In the content types element.xml also do the same leave the FieldRef “id” “name” same but change the displayname as Eg ( DisplayName="$Resources:Stringtest ")
·         Now create the list using the content type .You the change the list definition and instance also in the same way as specified above
·         You can now deploy and check everything will be multilingual.


But Please note that these resource files should be added to the sharepoint MAPPED RESOURCE folder and also open you feature property and change the “default resource file “ to “test
As our default resource file name in test