<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Kaushalendra</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/kaushalendra/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/kaushalendra/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:21:43 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to handle - The remote server returned an error: (403) Forbidden while connecting to SharePoint Online (O365)</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/how-to-handle-the-remote-server-returned-an-error-403-forbidden-while-connecting-to-sharepoint-online-o365</link>
      <pubDate>Tue, 22 Oct 2013 04:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/10/22/how-to-handle-the-remote-server-returned-an-error-403-forbidden-while-connecting-to-sharepoint-online-o365/</guid>
      <description><![CDATA[Recently while working on SharePoint, I found when I try to connect to SharePoint Online from...]]></description>
      <content:encoded><![CDATA[<p>Recently while working on SharePoint, I found when I try to connect to SharePoint Online from console application using CSOM and try authenticating using default network credential, I got 403 forbidden.</p>
<p>After looking bit into it, I realized it is because of the approach I was using to authenticate against the SharePoint Online.</p>
<p>In case of SharePoint online, If you need to&nbsp;create ClientContext using CSOM then you can use one of the following&nbsp;approaches</p>
<p>1) Using SharePointOnlineCredentials</p>
<p>Sample code snippet -</p>
<pre class="scroll"><code class="csharp">SecureString password = new SecureString();<br /> <br /> <br /> foreach (char c in "yourpassword".ToCharArray())<br /> password .AppendChar(c);<br /> <br /> clientContext.Credentials = new SharePointOnlineCredentials("yourUserName@yourDomain.onmicrosoft.com", password);<br /> </code></pre>
<p>2) Using AccessToken</p>
<p>In this case, Accesstoken gets used for creating the client context. In case you do not have access AccessToken and need access permissions on the fly, I would recommend you to read <a href="https://msdn.microsoft.com/en-us/library/jj687470.aspx">https://msdn.microsoft.com/en-us/library/jj687470.aspx</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Sorry, something went wrong in content by search web part for some users.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/sorry-something-went-wrong-in-content-by-search-web-part-for-some-users</link>
      <pubDate>Fri, 16 Aug 2013 01:32:07 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/08/16/sorry-something-went-wrong-in-content-by-search-web-part-for-some-users/</guid>
      <description><![CDATA[Recently I used content by search web part in SharePoint 2013. Web part was working perfectly fine...]]></description>
      <content:encoded><![CDATA[<p>Recently I used content by search web part in SharePoint 2013. Web part was working perfectly fine for all the site collection administrators. However when any other&nbsp;user was&nbsp;browsing the page, they were getting "Sorry, something went wrong".</p>
<p>After analysing all the queries and permission, I found that display templates I had uploaded did not have any published version. I published the major version and it started working.</p>
<p>In case you are getting same error, please ensure if display templates are published.</p>]]></content:encoded>
    </item>
    <item>
      <title>Creating web part page using client object model (CSOM) in SharePoint 2013 or 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/creating-web-part-page-using-client-object-model-csom-in-sharepoint-2013-or-2010</link>
      <pubDate>Mon, 22 Jul 2013 02:03:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/07/22/creating-web-part-page-using-client-object-model-csom-in-sharepoint-2013-or-2010/</guid>
      <description><![CDATA[It is common scenario to create web part page and there are many ways to do that. In this post, I...]]></description>
      <content:encoded><![CDATA[<p>It is common scenario to create web part page and there are many ways to do that. In this post, I will give steps to create the web part page programmatically using client object model.</p>
<p>First we need to ensure the target destination for the page we are creating. In this example I will create the web part page in "SitePages". We need to get the object for accessing "Site Pages". We can use code similar to code snippet mentioned below.</p>
<pre class="scroll"><code class="csharp">var sitePageLib = web.Lists.GetByTitle("Site Pages");<br /> clientContext.Load(sitePageLib);<br /> clientContext.ExecuteQuery();</code></pre>
<p>&nbsp;</p>
<p>Here I am assuming, we already have instantiated client context , web and other required object. In case, you need more detail on how to do that, I would recommend to read <a title="this" href="https://msdn.microsoft.com/en-us/library/fp179912.aspx" target="_blank">this</a> on msdn.</p>
<p>To create the web part page we need to create object of&nbsp;FileCreationInformation with required details.</p>
<p>Mainly we need to enter the details of Url and Content. Use "Url" to g<span>ets or sets a value that specifies the URL of the file to be added and Content for specifying &nbsp;the content of the file to be added.</span></p>
<pre class="scroll"><code class="csharp"> FileCreationInformation objFileInfo = new FileCreationInformation();<br /> objFileInfo.Url = "MyPage.aspx";<br /> <br /> string content = @"&lt;%@ Page language=""C#"" MasterPageFile=""~masterurl/default.master"" Inherits=""Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=16.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"" meta:webpartpageexpansion=""full"" meta:progid=""SharePoint.WebPartPage.Document"" %&gt;<br /> &lt;%@ Register Tagprefix=""SharePoint"" Namespace=""Microsoft.SharePoint.WebControls"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %&gt; <br /> &lt;%@ Register Tagprefix=""Utilities"" Namespace=""Microsoft.SharePoint.Utilities"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %&gt; <br /> &lt;%@ Import Namespace=""Microsoft.SharePoint"" %&gt; <br /> &lt;%@ Assembly Name=""Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %&gt; <br /> &lt;%@ Register Tagprefix=""WebPartPages"" Namespace=""Microsoft.SharePoint.WebPartPages"" Assembly=""Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"" %&gt;<br /> &lt;asp:Content ContentPlaceHolderId=""PlaceHolderPageTitle"" runat=""server""&gt;<br /> &lt;SharePoint:ListItemProperty Property=""BaseName"" maxlength=""40"" runat=""server""/&gt;<br /> &lt;/asp:Content&gt;<br /> &lt;asp:Content ContentPlaceHolderId=""PlaceHolderAdditionalPageHead"" runat=""server""&gt;<br /> &lt;meta name=""GENERATOR"" content=""Microsoft SharePoint"" /&gt;<br /> &lt;meta name=""ProgId"" content=""SharePoint.WebPartPage.Document"" /&gt;<br /> &lt;meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"" /&gt;<br /> &lt;meta name=""CollaborationServer"" content=""SharePoint Team Web Site"" /&gt;<br /> &lt;SharePoint:ScriptBlock runat=""server""&gt;<br /> var navBarHelpOverrideKey = ""WSSEndUser""; &lt;/SharePoint:ScriptBlock&gt;<br /> &lt;SharePoint:StyleBlock runat=""server""&gt;<br /> body #s4-leftpanel {<br /> display:none;<br /> }<br /> .s4-ca {<br /> margin-left:0px;<br /> }&lt;/SharePoint:StyleBlock&gt;<br /> &lt;/asp:Content&gt;<br /> &lt;asp:Content ContentPlaceHolderId=""PlaceHolderSearchArea"" runat=""server""&gt;<br /> &lt;SharePoint:DelegateControl runat=""server""<br /> ControlId=""SmallSearchInputBox""/&gt;<br /> &lt;/asp:Content&gt;<br /> &lt;asp:Content ContentPlaceHolderId=""PlaceHolderPageDescription"" runat=""server""&gt;<br /> &lt;SharePoint:ProjectProperty Property=""Description"" runat=""server""/&gt;<br /> &lt;/asp:Content&gt;<br /> &lt;asp:Content ContentPlaceHolderId=""PlaceHolderMain"" runat=""server""&gt;<br /> &lt;div class=""ms-hide""&gt;<br /> &lt;WebPartPages:WebPartZone runat=""server"" title=""loc:TitleBar"" id=""TitleBar"" AllowLayoutChange=""false"" AllowPersonalization=""false"" Style=""display:none;""&gt;&lt;ZoneTemplate&gt;<br /> &lt;WebPartPages:TitleBarWebPart runat=""server"" HeaderTitle=""MyPage"" Title=""Web Part Page Title Bar"" FrameType=""None"" SuppressWebPartChrome=""False"" Description="""" <br /> IsIncluded=""True"" ZoneID=""TitleBar"" PartOrder=""2"" FrameState=""Normal"" AllowRemove=""False"" AllowZoneChange=""True"" AllowMinimize=""False"" AllowConnect=""True"" <br /> AllowEdit=""True"" AllowHide=""True"" IsVisible=""True"" DetailLink="""" HelpLink="""" HelpMode=""Modeless"" Dir=""Default"" PartImageSmall="""" <br /> MissingAssembly=""Cannot import this Web Part."" PartImageLarge="""" IsIncludedFilter="""" ExportControlledProperties=""True"" <br /> ConnectionID=""00000000-0000-0000-0000-000000000000"" ID=""g_0793ac9d_8f08_49c3_8829_46f162a4e619"" AllowClose=""False"" ChromeType=""None"" <br /> ExportMode=""All"" __MarkupType=""vsattributemarkup"" __WebPartId=""{0793EC99-8F07-49C9-8823-46F162A4E614}"" WebPart=""true"" Height="""" Width=""""&gt;&lt;/WebPartPages:TitleBarWebPart&gt;<br /> <br /> &lt;/ZoneTemplate&gt;&lt;/WebPartPages:WebPartZone&gt;<br /> &lt;/div&gt;<br /> &lt;table class=""ms-core-tableNoSpace ms-webpartPage-root"" width=""100%""&gt;<br /> &lt;tr&gt;<br /> &lt;td id=""_invisibleIfEmpty"" name=""_invisibleIfEmpty"" valign=""top"" width=""100%""&gt; <br /> &lt;WebPartPages:WebPartZone runat=""server"" Title=""loc:FullPage"" ID=""FullPage"" FrameType=""TitleBarOnly""&gt;&lt;ZoneTemplate&gt;&lt;/ZoneTemplate&gt;&lt;/WebPartPages:WebPartZone&gt; &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;SharePoint:ScriptBlock runat=""server""&gt;if(typeof(MSOLayout_MakeInvisibleIfEmpty) == ""function"") {MSOLayout_MakeInvisibleIfEmpty();}&lt;/SharePoint:ScriptBlock&gt;<br /> &lt;/table&gt;<br /> &lt;/asp:Content&gt;<br /> ";<br /> <br /> objFileInfo.Content = System.Text.Encoding.ASCII.GetBytes(content); <br /> File file = sitePageLib.RootFolder.Files.Add(objFileInfo); <br /> clientContext.ExecuteQuery();</code></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>In the above code snippet, I am creating the FileCreationInformation with my page name as value in Url and Content being content of page. you can use SharePoint designer to get&nbsp;the content of&nbsp;page.</p>
<p>Next step is to add the file in "Site Pages" and execute the query.</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="csharp"></code>&nbsp;</pre>
<pre class="scroll"><code class="csharp"></code>&nbsp;</pre>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Error "Cannot complete this action.", while accessing term set collection object using Group.TermSets</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/error-cannot-complete-this-action-while-accessing-term-set-collection-object-using-group-termsets</link>
      <pubDate>Tue, 25 Jun 2013 06:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/06/25/error-cannot-complete-this-action-while-accessing-term-set-collection-object-using-group-termsets/</guid>
      <description><![CDATA[If you are getting error saying "cannot complete this action.", while accessing term set collection...]]></description>
      <content:encoded><![CDATA[<p>If you are getting error saying "cannot complete this action.", while accessing term set collection object using Group.TermSets with stack trace similar to</p>
<p>&nbsp;</p>
<p>at Microsoft.SharePoint.SPGlobal.HandleComException(COMExceptioncomEx)&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>at Microsoft.SharePoint.Library.SPRequest.CalculatePermissionsForCurrentThread(Object&amp;pvarAcl, Boolean bOnlyAces, UInt64&amp; pPermGrant, UInt64&amp; pPermDeny,Boolean&amp; pbIsSiteAdmin, Boolean&amp;pbIsSiteAuditor)&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>at Microsoft.SharePoint.Administration.SPAcl`1.CalculatePermissions()&nbsp;&nbsp;&nbsp;&nbsp;at Microsoft.SharePoint.Administration.SPAcl`1.EffectivePermissions()&nbsp;&nbsp;&nbsp;&nbsp;at Microsoft.SharePoint.Taxonomy.TermStore.GetEffectiveRights(SPAcl`1 acl, GuidgroupId)&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>at Microsoft.SharePoint.Taxonomy.TermStore.GetEffectiveRights(SPAcl`1 acl, GuidgroupId)&nbsp;&nbsp;&nbsp;&nbsp; at Microsoft.SharePoint.Taxonomy.Internal.Security.CanUserSeeTermSet(TermSet termSet)&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>at <span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-IN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Microsoft.SharePoint.Taxonomy.TermSet.TryCreateTermSet(SharedTermSetsharedTermSet, TermStore termStore)&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-IN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">at Microsoft.SharePoint.Taxonomy.TermSetCollection.CreateTermSetCollection(List`1sharedTermSets, TermStore termStore)&nbsp;&nbsp;&nbsp;</span></p>
<p>&nbsp;</p>
<p><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-IN; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">then you need to check all the term sets under this group for IsAvailable for tagging. If there is any term set with IsAvailable unchecked, you need to check this check box and save. After saving, you should be able to create TermSetCollection object using Groups.TermSets</span></p>]]></content:encoded>
    </item>
    <item>
      <title>ActiveX control cannot be instantiated because the current thread is not in a single-threaded apartment.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/activex-control-cannot-be-instantiated-because-the-current-thread-is-not-in-a-single-threaded-apartment</link>
      <pubDate>Wed, 05 Jun 2013 03:10:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/06/05/activex-control-cannot-be-instantiated-because-the-current-thread-is-not-in-a-single-threaded-apartment/</guid>
      <description><![CDATA[If you are getting error saying "ActiveX control cannot be instantiated because the current thread...]]></description>
      <content:encoded><![CDATA[<p>If you are getting error saying "ActiveX control cannot be instantiated because the current thread is not in a single-threaded apartment." then you need to apply STAThreadAttribute attribute to the entry point method.</p>
<p>Ex -</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [STAThread]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static void Main(string[] args)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>This attribute indicates that the COM threading model for an application is single-threaded apartment (STA).</p>
<p>for more details please refer <a href="https://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx">https://msdn.microsoft.com/en-us/library/system.stathreadattribute.aspx.</a></p>
<p>&nbsp;&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>File or arguments not valid for site template while creating SharePoint 2013 site collection using SharePoint 2010 site template</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/file-or-arguments-not-valid-for-site-template-while-creating-sharepoint-2013-site-collection-using-sharepoint-2010-site-template</link>
      <pubDate>Sun, 07 Apr 2013 22:59:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/04/07/file-or-arguments-not-valid-for-site-template-while-creating-sharepoint-2013-site-collection-using-sharepoint-2010-site-template/</guid>
      <description><![CDATA[If you are trying to create site collection in SharePoint 2013 using SharePoint 2010 site template,...]]></description>
      <content:encoded><![CDATA[<p>If you are trying to create site collection in SharePoint 2013 using SharePoint 2010 site template, then you need to provide CompatibilityLevel in New-SPSite cmdlet.</p>
<p>CompatibilityLevel&nbsp; specifies the version of site template to use when creating the site collection using New-SPSite. The values for CompatibilityLevel&nbsp; can be either 14 for SharePoint Server 2010 experience sites or 15 for SharePoint Server 2013 experience sites . When this parameter is not specified, the CompatibilityLevel will default to the highest possible version for the web application depending on the CompatibilityRange setting.</p>
<p>&nbsp;</p>
<p>For more detail, please check <a title="New-SPSite" href="https://technet.microsoft.com/en-us/library/ff607937.aspx" target="_blank">New-SPSite</a> cmdlet</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Accessing taxonomy/managed metadata in SharePoint app using client object model.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/accessing-taxonomymanaged-metadata-in-sharepoint-app-using-client-object-model</link>
      <pubDate>Sun, 07 Apr 2013 02:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2013/04/07/accessing-taxonomymanaged-metadata-in-sharepoint-app-using-client-object-model/</guid>
      <description><![CDATA[In SharePoint 2013, app&nbsp;is one of key areas. Apps provide easy way to add functionality in...]]></description>
      <content:encoded><![CDATA[<p>In SharePoint 2013, app&nbsp;is one of key areas. Apps provide easy way to add functionality in SharePoint. It may be required to read/write managed metadata from apps. In this blog, I will cover how to access managed metadata using client object model.</p>
<p>First, we need to do add reference of Microsoft.SharePoint.Client.Taxonomy, location&nbsp;is&nbsp;&nbsp;\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll&nbsp;in 15 hive</p>
<p>Then, we need to specify type of permission (Read/Write)&nbsp;app needs on Taxonomy. Steps for that</p>
<ul>
<li>Click on AppManifest.Xml</li>
<li>Go to Permissions tab</li>
<li>In permission requests, select scope = Taxonomy, Permission = Read/Writes (as applicable in your case)</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/45/45/8233.Permission.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-45-45/8233.Permission.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/45/45/8233.Permission.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-45-45/8233.Permission.jpg" alt="" border="0" /></a></p>
<p>Next we need to access the TermStore , Groups ,TermSet&nbsp; etc. This is bit similar to the way, it gets done in sever side code. One major difference is we need to request for data explicitly.</p>
<p>&nbsp;var contextToken = TokenHelper.GetContextTokenFromRequest(Page.Request);</p>
<p>&nbsp;var hostWeb = Page.Request["SPHostUrl"];</p>
<p>&nbsp;using (var clientContext = TokenHelper.GetClientContextWithContextToken(hostWeb, contextToken, Request.Url.Authority))</p>
<p>&nbsp;{</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TaxonomySession session= TaxonomySession.GetTaxonomySession(clientContext);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clientContext.Load(session.TermStores);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientContext.ExecuteQuery();</p>
<p>}</p>
<p>First 3 lines gets context token , host web url and client context respectively. You would be&nbsp;familiar with them if you have written any app before.</p>
<p>In next line, we are creating TaxonomySession using clientContext , then we load the TermStores. After&nbsp;ExecuteQuery , session.TermStores will be available.</p>
<p>&nbsp;</p>
<p>For groups -</p>
<p>clientContext.Load(termstore.Groups);&nbsp;</p>
<p>clientContext.ExecuteQuery();</p>
<p>&nbsp;// termstore is object of TermStore which can be retrived from TermStoreCollection (in the above code from&nbsp;session.TermStores)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Similary for TermSet and Terms</p>
<p>clientContext.Load(group.TermSets);</p>
<p>clientContext.ExecuteQuery();</p>
<p>// group is object of TermGroup which can be retrived from TermGroupCollection (in the above code from&nbsp;termstore.Groups)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>clientContext.Load(termset.Terms);</p>
<p>clientContext.ExecuteQuery();</p>
<p>// termset is object of TermSet which can be retrived from TermSetCollection (in the above code from&nbsp;group.TermSets)</p>
<p>&nbsp;</p>
<p>&nbsp;One difference you would have noticed is Class for group is TermGroup and not Group which is in server side code.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Flyout menu on touch screen.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/flyout-menu-on-touch-screen</link>
      <pubDate>Wed, 12 Dec 2012 06:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2012/12/12/flyout-menu-on-touch-screen/</guid>
      <description><![CDATA[Flyout menu is very common way of displaying menu. It works pretty well while interacting using...]]></description>
      <content:encoded><![CDATA[<p>Flyout menu is very common way of displaying menu. It works pretty well while interacting using mouse because&nbsp;with mouse it is easier to capture mouseover and mouseout event.</p>
<p>If the device is touch enabled, then getting flyout menu gets tricky because there is no equivalent of hover in&nbsp;touch-based browsing.</p>
<p><strong>Internet Explorer&nbsp;10 on Windows&nbsp;8</strong> introduces a new use for the <strong>aria-haspopup&nbsp;&nbsp;</strong>DOM property,&nbsp;simulating hover on touch-enabled devices.</p>
<p>To make flyout work in Internet Explorer&nbsp;10 on Windows&nbsp;8, set the <strong>aria-haspopup = true</strong> on menu item (so that submenu items can come as flyout) and set<strong> aria-haspopup = false </strong>on submenu items (so that sub menu items can be clicked).</p>
<p>Enabling the <strong>aria-haspopup </strong>property doesn't change the behavior of your webpage for visitors using a mouse and keyboard.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to sync taxonomy hidden list using PowerShell.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/how-to-sync-taxonomy-hidden-list-using-powershell</link>
      <pubDate>Tue, 16 Oct 2012 04:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2012/10/16/how-to-sync-taxonomy-hidden-list-using-powershell/</guid>
      <description><![CDATA[Taxonomy hidden list&nbsp;gets synced&nbsp;by timer job however there may be scenario when we may...]]></description>
      <content:encoded><![CDATA[<p>Taxonomy hidden list&nbsp;gets synced&nbsp;by timer job however there may be scenario when we may have to update the taxonomy hidden list manually.&nbsp;</p>
<p>&nbsp;</p>
<p>One way to manually update the taxonomy hidden list is using PowerShell script.&nbsp;To update the taxonomy hidden list, we need to call the SyncHiddenList method of TaxonomySession. SyncHiddenList&nbsp; is static method and takes SPSite as object.</p>
<p>&nbsp;</p>
<p>Sample PowerShell -</p>
<p>Get-SPWebApplication $siteUrl | Get-SPSite -limit ALL | foreach {&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Microsoft.SharePoint.Taxonomy.TaxonomySession]::SyncHiddenList($_)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;}</p>
<p>&nbsp;Above code sync all Taxonomy hidden list in all the site collection in specified web application.</p>
<p>&nbsp;If you want to sync taxonomy hidden list on specific site collection you can run-</p>
<p>[Microsoft.SharePoint.Taxonomy.TaxonomySession]::SyncHiddenList($siteCollectionObject)&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Sharepoint List Id using javascript and list.asmx.</title>
      <link>https://docs.microsoft.com/archive/blogs/kaushalendra/getting-sharepoint-list-id-using-javascript-and-list-asmx</link>
      <pubDate>Sun, 22 Apr 2012 04:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Kaushalendra Kumar]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kaushalendra/2012/04/22/getting-sharepoint-list-id-using-javascript-and-list-asmx/</guid>
      <description><![CDATA[Many times, we may need list id of sharepoint list in javascript, for example we may need to create...]]></description>
      <content:encoded><![CDATA[<p>Many times, we may need list id of sharepoint list in javascript, for example we may need to create a link for list new item form. One way is to find the list id manually and hard code in the link. If this solution need to be deployed in other environment then we will&nbsp;have to modify the hard coded list id. Other option is to read the list id dynamically and update the link.</p>
<p>One of possible ways to get list id is using list.asmx. Below is the sample code to read list id using javascript and list.asmx.In the below code , we are calling List.asmx on the sitecollection. On the success of call we get xml with information about the list. After that we find the Id of list from xml and update the href link or use id as per requirement.</p>
<pre class="scroll"><code class="js">function GetListID() {<br /> <br /> /* url of site collection + /_vti_bin/Lists.asmx */<br /> wsURL = "https://..../_vti_bin/Lists.asmx"<br /> <br /> var soapEnv = "&lt;soap:Envelope xmlns:xsi='https://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='https://www.w3.org/2001/XMLSchema' xmlns:soap='https://schemas.xmlsoap.org/soap/envelope/'&gt; &lt;soap:Body&gt; &lt;GetList xmlns='https://schemas.microsoft.com/sharepoint/soap/'&gt; &lt;listName&gt;ListNameWhoseIdIsNeeded&lt;/listName&gt;&lt;/GetList&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;";<br /> <br /> <br /> $.ajax({<br /> url: wsURL,<br /> type: "POST",<br /> dataType: "xml",<br /> data: soapEnv,<br /> complete: callComplete,<br /> contentType: "text/xml; charset=\"utf-8\""<br /> });<br />}</code></pre>
<pre class="scroll"><code class="js">function callComplete(xData, status) {<br /> var id<br /> $(xData.responseText).find("List").each(function () {<br /> id = $(this).attr('ID');<br /> });<br /> <br /> /* Now you have list id in id variable...<br /> all we need to do is update the <br /> href of link with this id */<br /> <br /> }<br /> </code></pre>]]></content:encoded>
    </item>
  </channel>
</rss>