<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1997439109259893550</id><updated>2024-10-24T23:07:59.576-07:00</updated><category term="Sharepoint"/><category term="HTML5"/><category term="Assembly"/><category term="Create Sharepoint Site"/><category term="Dropdown list"/><category term="ListBox"/><category term="Ning"/><category term="Sharepoint 2013"/><category term="Signing a dll"/><category term="Strong Name"/><category term="Visual Studio"/><category term="WSP Solution"/><category term="acess machine.config with c#"/><category term="global assembly cache"/><category term=".net"/><category term="70-480 Exam"/><category term="Accessing Custom Web Control Properties in C# Code Behind Programmatically"/><category term="ApplyWebConfigModifications()"/><category term="CAML Query to search on URL field in SharePoint"/><category term="Calculated Formulas"/><category term="Chrome"/><category term="Client side rendering"/><category term="Content Type"/><category term="Copy folder files and subfolders recursively"/><category term="Copying dll from GAC"/><category term="Create SPFile"/><category term="Create Sharepoint Subsites"/><category term="Create Wiki Pages in Wiki Pages Library"/><category term="Create Xml"/><category term="Creating sharpoint navigation"/><category term="Custom fields to Sharepoint list"/><category term="Custom thumbnails"/><category term="Database is in use to restore. Sharepoint database restore failed."/><category term="Delete all webparts from Sharepoint Page Programmatically"/><category term="Detailed error of Sharepoint"/><category term="Detect if a Guid"/><category term="Display Templates"/><category term="Drop a sql server database"/><category term="DropDownList with SPList.Items"/><category term="Embed Videos"/><category term="Enable Target Audience programmatically in Sharepoint"/><category term="Error"/><category term="EventReceiver"/><category term="Examples to deploy and retract Sharepoint solutions"/><category term="Feature Installation"/><category term="Firefox"/><category term="Floating div not displaying background color.Floating divs"/><category term="GAC"/><category term="GAC file get"/><category term="Get Blob and Save it to Filesystem"/><category term="Get FeatureId from FeatureFolder"/><category term="Get Sharepoint Title Field value"/><category term="Get Site Definition from a sharepoint site"/><category term="Get current logged user in Windows"/><category term="Get list definition from a sharepoint list"/><category term="Getting same HashCode for 32-bit and 64-bit"/><category term="HRESULT : 0x81070215"/><category term="How to add robots to .Net Application"/><category term="IE"/><category term="Install windows service and uninstall windows service"/><category term="Internet explorer"/><category term="IsCurrentUserMemberOfGroup"/><category term="JSLink"/><category term="JSLink Examples"/><category term="Jquery"/><category term="Jquery Integration"/><category term="Jquery and Webpart"/><category term="LinkFilename column CAML query"/><category term="List to provision"/><category term="ListFormWebPart.JSLink"/><category term="Lists the Sql Server Databases"/><category term="Logging"/><category term="MCSD Start Exam"/><category term="Modify Sharepoint web.config"/><category term="Mozilla"/><category term="Office Live"/><category term="OpenID"/><category term="Opening PDF Files in SharePoint 2010 inside browser."/><category term="Operation is not valid due to the current state of the object."/><category term="PHP"/><category term="Page.IsPostBack"/><category term="PdfSharp"/><category term="Populate DropDownlist with SharePoint List Items Programmatically"/><category term="Preparation fr 70-480 Exam"/><category term="Programming in HTML5 with JavaScript and CSS3 Exam"/><category term="Programming with Wiki Pages Library"/><category term="Random Numbers"/><category term="Read Xml"/><category term="Reading external prameters inside feature receiver"/><category term="Redirect from Iframe to parent via codebehind of page"/><category term="Remote debugging Webparts"/><category term="Restore Sharepoint Content Database"/><category term="Ribbon"/><category term="Ribbon Customization"/><category term="SNK"/><category term="SPFieldMultiChoice"/><category term="SPForm.JSLink"/><category term="SPForm.JSLink does not updated"/><category term="SPSite Best practices not used"/><category term="SPWebConfigModification"/><category term="Save XMl"/><category term="Server did not recognize the value of HTTP Header SOAPAction"/><category term="Set background image to TR"/><category term="SharePoint 2010"/><category term="SharePoint Object MOdel"/><category term="SharePoint Ribbon Button for specific Content Type"/><category term="Sharepoint 2013 JSLink"/><category term="Sharepoint 2013 Promoted Links List as ListViewWebPart Programmatically"/><category term="Sharepoint Custom webservices under layouts folder"/><category term="Sharepoint FAQs"/><category term="Sharepoint Feature Cleaner"/><category term="Sharepoint Foundation 2010 Product Key"/><category term="Sharepoint Groups"/><category term="Sharepoint List"/><category term="Sharepoint Powershell for Export and Import SPWeb"/><category term="Sharepoint SearchBox"/><category term="Sharepoint Solution Generator"/><category term="Sharepoint Web.Config"/><category term="Sharepoint current context user"/><category term="Sharepoint file icon from Item Url"/><category term="Sharepoint foundation 2010 installation"/><category term="Sharepoint interview questions"/><category term="Sharepoint jobs"/><category term="Sharepoint limits"/><category term="Showing Full Errors in Sharepoint"/><category term="Showing/Style specific Content Type Items with JSLink in SharePoint 2013"/><category term="Stored Procccedures vs SQL Inline code"/><category term="String.GetHashCode() for 64-bit and 32-bit"/><category term="Sub Folder in Sharepoint Programmatically"/><category term="TaxonomyField"/><category term="The node to be removed is not a child of this node"/><category term="Thread abort exception"/><category term="Trying to use an SPWeb object that has been closed or disposed and is no longer valid."/><category term="Update SPFile"/><category term="Update SPForm JSLInk"/><category term="Update TaxonomyField Programmatically"/><category term="Updating SPListItem TaxonomyField Programmatically"/><category term="Video Thumbnails"/><category term="WCMS"/><category term="WSS 3.0"/><category term="What happens when SPWeb"/><category term="Windows Services"/><category term="XSLT String:replace()"/><category term="add custom list to a site"/><category term="add robot.txt for Sharepoint"/><category term="add robots.txt to a website"/><category term="asp.net"/><category term="assembly-signing"/><category term="c#"/><category term="create publishing page programatically"/><category term="creating sharepoint site and subsites"/><category term="display background color to div"/><category term="embed flash"/><category term="error occurred while parsing EntityName"/><category term="export emails"/><category term="export file"/><category term="fanbox"/><category term="friendster"/><category term="hi5"/><category term="indexOf function with XSLT"/><category term="install"/><category term="is in a List&lt;Guid?&gt;"/><category term="load machine.config into XMLDocument in c#"/><category term="load parent window with a url from different domain iframe"/><category term="log4Net"/><category term="machine.config"/><category term="myspace"/><category term="network subdomain"/><category term="ning.core.getNetworkDomain()"/><category term="opensocial"/><category term="opensocial.getEnvironment().getDomain()"/><category term="operation could not be completed because the item was removed from the gallery sharepoint 2013"/><category term="orkut"/><category term="page"/><category term="robots"/><category term="save to file system"/><category term="scroll up. scroll down"/><category term="security validation for this page is invalid"/><category term="setting RegistryValueKind.MultiString"/><category term="sharepoint feature receiver"/><category term="uninstall using c#"/><category term="windows service"/><title type='text'>kicktech</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01040082801064577874</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>112</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-456219932088476092</id><published>2014-02-04T06:00:00.000-08:00</published><updated>2014-02-04T06:02:07.344-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="display background color to div"/><category scheme="http://www.blogger.com/atom/ns#" term="Floating div not displaying background color.Floating divs"/><title type='text'>Floating div not displaying background color.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;div class=&quot;code&quot;&gt;
&amp;lt;div id=&quot;wrapper&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;div id=&quot;content&quot;&amp;gt;&lt;br/&gt;
      &amp;lt;div id=&quot;slider&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br/&gt;
&lt;br/&gt;
      &amp;lt;div id=&quot;left&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br/&gt;
&lt;br/&gt;
      &amp;lt;div id=&quot;right&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br/&gt;
   &amp;lt;/div&gt;&lt;br/&gt;
  &amp;lt;/div&gt;&lt;br/&gt;
#left&lt;br/&gt;
{&lt;br/&gt;
  float:left;&lt;br/&gt;
  width:490px;&lt;br/&gt;
}&lt;br/&gt;&lt;br/&gt;

#right&lt;br/&gt;
{&lt;br/&gt;
  float:right;&lt;br/&gt;
  width:490px;&lt;br/&gt;
}&lt;br/&gt;
#wrapper&lt;br/&gt;
{&lt;br/&gt;
  background:blue;&lt;br/&gt;
  width:990px;&lt;br/&gt;
  margin:0 auto;&lt;br/&gt;
}&lt;br/&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;br/&gt;

The problem with the float based layouts is that the wrapper container doesn&#39;t expand to the height of the child floating elements. The typical solution to fix this is by adding an element with &lt;b&gt;clear float after the floating elements&lt;/b&gt; or &lt;b&gt;adding a clearfix to the wrapper&lt;/b&gt;. But you can also &lt;b&gt;use the overflow property to fix this problem&lt;/b&gt;. It is not a CSS trick. It&#39;s documented long time back.

&lt;br/&gt;
&lt;br/&gt;
So it would be:&lt;br/&gt;

&lt;div class=&quot;code&quot;&gt;
#wrapper&lt;br/&gt;
{&lt;br/&gt;
  background:blue;&lt;br/&gt;
  width:990px;&lt;br/&gt;
  margin:0 auto;&lt;br/&gt;
overflow:hidden&lt;br/&gt;
}
&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/456219932088476092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/456219932088476092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/456219932088476092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/456219932088476092'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/02/floating-div-not-displaying-background.html' title='Floating div not displaying background color.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-812278990440478022</id><published>2014-01-28T04:06:00.001-08:00</published><updated>2014-01-28T04:11:36.998-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Detect if a Guid"/><category scheme="http://www.blogger.com/atom/ns#" term="is in a List&lt;Guid?&gt;"/><title type='text'>Detect if a Guid, is in a List</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Sample Code here:&lt;/b&gt;

&lt;br/&gt;&lt;br/&gt;
&lt;div class=&quot;code&quot;&gt;
Guid x = Guid.Empty;&lt;br/&gt;
List&lt;Guid&gt; y = new List&lt;Guid&gt;();&lt;br/&gt;
y.Add(x);&lt;br/&gt;
&lt;br/&gt;
Console.WriteLine(y.Contains(x)); // True&lt;br/&gt;
Console.WriteLine(y.Contains(Guid.Empty)); // True&lt;br/&gt;
&lt;/div&gt;

&lt;br/&gt;
With Linq: &lt;br/&gt;
&lt;div class=&quot;code&quot;&gt;
var myList = new List&lt;Guid&gt;()&lt;br/&gt;
 Guid uniqueGuidId = new Guid(uniqueId[1]);;&lt;br/&gt;
var theEmpties = myList.Where(x =&gt; x.ToString() == uniqueGuidId.ToString());&lt;br/&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/812278990440478022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/812278990440478022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/812278990440478022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/812278990440478022'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/detect-if-guid-is-in-list.html' title='Detect if a Guid, is in a List&lt;Guid?&gt;'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-6018368764963635307</id><published>2014-01-28T01:25:00.001-08:00</published><updated>2014-01-28T04:15:02.478-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Accessing Custom Web Control Properties in C# Code Behind Programmatically"/><title type='text'>Accessing Custom Web Control Properties in C# Code Behind Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
For User Controls it&#39;s necessary that we need to access custom control properties in the code behind and it will be a single heading property that we have to set. First time we may take some time too. I am just sharing how we can do this.&lt;br /&gt;
&lt;br /&gt;
1. First we have to set the Custom property on the control it self.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;MyControls:CriteriaControl runat=&quot;server&quot; ID=&quot;CriteriaControl&quot; MyMode=&quot;File&quot;&amp;gt; &lt;br /&gt;
&amp;lt;/MyControls:CriteriaControl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Then, in the code behind we need to set the DesignerSerializationVisibility property to Content as below:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;private string myMode;&lt;br /&gt;
[PersistenceMode(PersistenceMode.InnerProperty),&lt;br /&gt;
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]&lt;br /&gt;
public string MyMode&lt;br /&gt;
{&lt;br /&gt;
get&lt;br /&gt;
{&lt;br /&gt;
return &amp;nbsp;myMode;&lt;br /&gt;
}&lt;br /&gt;
set&lt;br /&gt;
{&lt;br /&gt;
myMode = value;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;The description about this property is here: &lt;/b&gt;&lt;br /&gt;
This attribute takes one parameter, which is a &lt;b&gt;System.ComponentModel.DesignerSerializationVisibility &lt;/b&gt;enumeration member:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Visible &lt;/b&gt;- specifies that the object should be serialized. Use this value for simple (or primitive) properties.&lt;br /&gt;
&lt;b&gt;Content &lt;/b&gt;- specifies that contents of the object should be serialized. Use this value for complex (or non-primitive) properties and collections.&lt;br /&gt;
&lt;b&gt;Hidden&lt;/b&gt;- specifies that the object should not be serialized. Use this value when properties are changed for design-time purposes only, but should not be serialized in code.&lt;br /&gt;
&lt;br /&gt;
Hope this helps someone too.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/6018368764963635307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/6018368764963635307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6018368764963635307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6018368764963635307'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/accessing-custom-web-control-properties.html' title='Accessing Custom Web Control Properties in C# Code Behind Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-4976580563674893896</id><published>2014-01-22T07:03:00.000-08:00</published><updated>2014-01-22T07:03:13.911-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DropDownList with SPList.Items"/><category scheme="http://www.blogger.com/atom/ns#" term="Populate DropDownlist with SharePoint List Items Programmatically"/><title type='text'>Populate DropDownlist with SharePoint List Items Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For populating or filling asp:DropDownList with Sharepoint List Items programmatically, below is sample code:
&lt;div class=&quot;code&quot;&gt;
if (!Page.IsPostBack)&lt;br /&gt;
{&lt;br /&gt;
using (SPSite site = new (&quot;http://server/site&quot;))&lt;br /&gt;
{&lt;br /&gt;
using (SPWeb web = site.OpenWeb())&lt;br /&gt;
{&lt;br /&gt;
SPList list = web.Lists[&quot;ListName&quot;];&lt;br /&gt;
dropDownList.DataSource = list.Items;&lt;br /&gt;
dropDownList.DataValueField = &quot;Title&quot;; // List field holding value - first column is called Title anyway!&lt;br /&gt;
dropDownList.DataTextField = &quot;Title&quot;; // List field holding name to be displayed on page &lt;br /&gt;
dropDownList.DataBind();&lt;br /&gt;
}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;

&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/4976580563674893896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/4976580563674893896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/4976580563674893896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/4976580563674893896'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/populate-dropdownlist-with-sharepoint.html' title='Populate DropDownlist with SharePoint List Items Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-1448627060277330665</id><published>2014-01-21T08:01:00.000-08:00</published><updated>2014-02-04T00:17:17.749-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TaxonomyField"/><category scheme="http://www.blogger.com/atom/ns#" term="Update TaxonomyField Programmatically"/><category scheme="http://www.blogger.com/atom/ns#" term="Updating SPListItem TaxonomyField Programmatically"/><title type='text'>Updating SPListItem TaxonomyField Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
I spent more than 3 hours for updating SPListItem with Taxonomy Field. I did at the beginning like other Fields. But my application failed saying that &quot;The given Guid does not exist in the term store&quot;. I was surprised by why it is accessing Term Store. Thought very stupid Error!&lt;br /&gt;
&lt;br /&gt;
After doing some research, found that we have to update Taxonomy Fields differently. The following steps should be done:&lt;br /&gt;
&lt;br /&gt;
1. We have get the TaxonomyField first.&lt;br /&gt;
2. Open TaxonomySession and get associated term store&lt;br /&gt;
3. Get the Term that we want to update&lt;br /&gt;
&lt;br /&gt;
Here is example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
    string TaxonomyFieldGuid = &quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&quot;;&lt;br /&gt;
    TaxonomyField taxField = listItem.ParentList.Fields[new Guid(TaxonomyFieldGuid)] as TaxonomyField;&lt;br /&gt;
    if (taxField != null)&lt;br /&gt;
    {               &lt;br /&gt;
       TaxonomySession session = new TaxonomySession(SPContext.Current.Site);&lt;br /&gt;
       TermStore termStore = session.TermStores[0];&lt;br /&gt;&lt;br /&gt;
               
       Term term = termStore.GetTerm(new Guid(TermGuid).ToString())); &lt;br /&gt;              
       taxField.SetFieldValue(listItem, term); &lt;br /&gt;              
    } &lt;br /&gt; 
    listItem.Update()  &lt;br /&gt;
&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;
It worked for me perfectly!!
&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;Reference:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.insidesharepoint.net/post/2010/11/21/Using-taxonomy-fields-in-Sharepoint-2010-Part-II.aspx&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://www.insidesharepoint.net/post/2010/11/21/Using-taxonomy-fields-in-Sharepoint-2010-Part-II.aspx&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://blogs.msdn.com/b/sharepointdev/archive/2011/11/18/how-to-work-with-managed-metadata-columns-by-using-the-sharepoint-client-object-model-kaushalendra-kumar.aspx&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://blogs.msdn.com/b/sharepointdev/archive/2011/11/18/how-to-work-with-managed-metadata-columns-by-using-the-sharepoint-client-object-model-kaushalendra-kumar.aspx&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/1448627060277330665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/1448627060277330665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/1448627060277330665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/1448627060277330665'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/updating-splistitem-taxonomyfield.html' title='Updating SPListItem TaxonomyField Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-8154105305683822554</id><published>2014-01-17T14:40:00.003-08:00</published><updated>2014-01-21T06:26:35.418-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Content Type"/><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon"/><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Ribbon Button for specific Content Type"/><title type='text'>SharePoint Ribbon Button for specific Content Type documents only</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I am not going to explain the basics and description about Ribbon commands. Here I go directly into the logic. &lt;br /&gt;
There are many blogs which explaing about commands and I also reference them at the end of this &lt;a href=&quot;#ref&quot;&gt;post&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
As the post said, we have&lt;b&gt; several content types&lt;/b&gt; enabled for a single document library. We want to show only the &lt;b&gt;Hello Ribbon Button only for ABC ContentType Id&lt;/b&gt;. I tried like below and it is showing the Hello button in Ribbon for all documents of all content types in the library.
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&amp;lt;CustomAction Id=&quot;MyDocuments&quot; Location=&quot;CommandUI.Ribbon&quot; Rights=&quot;AddListItems&quot;
                RegistrationType=&quot;ContentType&quot;  
                RegistrationId=&quot;ABC&quot;&amp;gt;&lt;br /&gt;
&amp;lt;CommandUIExtension&amp;gt;&lt;br /&gt;
&amp;lt;CommandUIDefinitions&amp;gt;&lt;br /&gt;
&amp;lt;CommandUIDefinition Location=&quot;Ribbon.Documents.EditCheckout.Controls._children&quot;&amp;gt;&lt;br /&gt;
&amp;lt;Button Id=&quot;Ribbon.MyArticle&quot;         
               Command=&quot;Ribbon.MyArticleCommand&quot;
               LabelText=&quot;$Resources:MyResource,RibbonButton_Sample;&quot;
               TemplateAlias=&quot;o1&quot;
               Sequence=&quot;20&quot;
               Image16by16=&quot;~site/_layouts/images/docset_captureversion_16.png&quot;
               Image32by32=&quot;~site/_layouts/images/docset_captureversion_32.png&quot;
            /&amp;gt;&lt;br /&gt;
&amp;lt;/CommandUIDefinition&amp;gt;&lt;br /&gt;
&amp;lt;/CommandUIDefinitions&amp;gt;&lt;br /&gt;
&amp;lt;CommandUIHandlers&amp;gt;&lt;br /&gt;
&amp;lt;CommandUIHandler Command=&quot;Ribbon.ArticleCommand&quot;
                                 CommandAction=&quot;javascript:if (LaunchCreateHandler(&#39;PublishingPage&#39;)) { var sourceId = encodeURIComponent(window.location);SP.UI.ModalDialog.OpenPopUpPage(&#39;{SiteUrl}/_layouts/15/Hello/CreatePublishingPageDialog.aspx?source=&#39; + sourceId, null, 390); };&quot; /&amp;gt;   &lt;br /&gt;
&amp;lt;/CommandUIHandlers&amp;gt;&lt;br /&gt;
&amp;lt;/CommandUIExtension&amp;gt;&lt;br /&gt;
&amp;lt;/CustomAction&amp;gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I tried to display the Ribbon button only for ABC content type documents, but &lt;b&gt;Sharepoint is always showing the Ribbon button for all documents from all content types in the current document library&lt;/b&gt;. Seems it is not possible with the CommandAction, we have to implement a client side scenario for EnableScript.&lt;br /&gt;
&lt;br /&gt;

&lt;a id=&quot;ref&quot; href=&quot;#&quot;&gt;References:&lt;/a&gt;

&lt;br /&gt;
&lt;br /&gt;
1. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg552606(v=office.14).aspx&quot;&gt;Customizing and Extending the SharePoint 2010 Server Ribbon&lt;/a&gt;&lt;br /&gt;
2. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/office/ff407290(v=office.14).aspx&quot;&gt;Server Ribbon XML&lt;/a&gt;&lt;br /&gt;
3. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/office/ff407458(v=office.14).aspx&quot;&gt;Walkthrough: Adding a Button to the Server Ribbon&lt;/a&gt;&lt;br /&gt;
4. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/office/ee537017(v=office.14).aspx&quot;&gt;Architecture of the Server Ribbon&lt;/a&gt;&lt;br /&gt;
5. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms460194.aspx&quot;&gt;CustomAction Element&lt;/a&gt;&lt;br /&gt;
6. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb802730.aspx&quot;&gt;Default Custom Action Locations and IDs&lt;/a&gt;&lt;br /&gt;
7. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee537543.aspx&quot;&gt;Default Server Ribbon Customization Locations&lt;/a&gt;&lt;br /&gt;
8. &lt;a href=&quot;http://howtosharepoint.blogspot.de/2010/06/ribbon-basics.html&quot;&gt;Ribbon customization : Basics&lt;/a&gt;&lt;br /&gt;
9. &lt;a href=&quot;http://social.technet.microsoft.com/Forums/sharepoint/en-US/faee6591-c7e1-4ffe-b5ef-2b8c3292794e/customize-ribbon-of-sharepoint-list-item-viewedit-page?forum=sharepointgeneral&quot;&gt;Customize Ribbon of SharePoint List Item View/Edit page&lt;/a&gt;&lt;br /&gt;
10. &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms473643.aspx&quot;&gt;How to: Modify the User Interface Using Custom Actions&lt;/a&gt;&lt;br /&gt;
11. &lt;a href=&quot;http://www.learningsharepoint.com/2011/05/27/sharepoint-2010-ribbon-locations/&quot;&gt;Sharepoint 2010 Ribbon Locations&lt;/a&gt;&lt;br /&gt;
12. &lt;a href=&quot;http://koenvosters.wordpress.com/2009/11/05/howto-add-a-button-to-the-ribbon-in-sharepoint-2010/&quot;&gt;HOWTO: Add a button to the ribbon in SharePoint 2010&lt;/a&gt;&lt;br /&gt;
13.&lt;a href=&quot;http://tihomirignatov.blogspot.de/2011/10/ribbon-customizations-and-customactions.html&quot;&gt; Ribbon Customizations and CustomActions in SharePoint 2010&lt;/a&gt;&lt;br /&gt;
14. &lt;a href=&quot;http://www.sharepointnutsandbolts.com/2010/01/customizing-ribbon-part-1-creating-tabs.html&quot;&gt;Customizing ribbon part-1 creating tabs, groups, controls&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/8154105305683822554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/8154105305683822554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8154105305683822554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8154105305683822554'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/sharepoint-ribbon-button-for-specific.html' title='SharePoint Ribbon Button for specific Content Type documents only'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-3882157381622278366</id><published>2014-01-17T04:35:00.006-08:00</published><updated>2014-01-17T04:47:22.294-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Client side rendering"/><category scheme="http://www.blogger.com/atom/ns#" term="Display Templates"/><category scheme="http://www.blogger.com/atom/ns#" term="JSLink"/><category scheme="http://www.blogger.com/atom/ns#" term="JSLink Examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint 2013"/><category scheme="http://www.blogger.com/atom/ns#" term="Showing/Style specific Content Type Items with JSLink in SharePoint 2013"/><title type='text'>Showing/Style specific Content Type Items with JSLink in SharePoint 2013</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was planning to post about JSLink examples since long time. Every time I postpone. For me it will be a reference for myself in the future. Microsoft has made developers life easy with JSLink.&lt;br /&gt;
&lt;br /&gt;
What is JSLink for?&lt;br /&gt;
JSLink can be used to style List Form Views, Web Part Views, Fields and Search Results and many more.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Showing specific Content Type Items with JSLink.&amp;nbsp;&lt;/h2&gt;
You can use the following function for calling template renderings:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
function applyTemplates() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var itemCtx = {};&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates = {};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Header = headerTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Item = itemTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Footer = footerTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx);&lt;br /&gt;
}&lt;br /&gt;

applyTemplates();&lt;br /&gt;
&lt;/div&gt;

&lt;br /&gt;
Or you could also use like below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
(function() {&lt;br /&gt;
var itemCtx = {};&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates = {};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Header = headerTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Item = itemTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;itemCtx.Templates.Footer = footerTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx);&lt;br /&gt;
});&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
Since we want to style only specific items in the view, we don&#39;t change anything in Header and Footer Templates. The Header and Footer Templates are called only once while rendering the page. The Header and Footer Templates will look like below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
function headerTemplate(ctx) { &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var header = RenderHeaderTemplate(ctx);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return header;&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
function footerTemplate(ctx) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;var footer = RenderFooterTemplate(ctx);&lt;br /&gt;
&amp;nbsp; return footer;&lt;br /&gt;
}
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The ItemTemplate should be changed. If we have multiple content types and we want to differentiate the items in the view then we can check if the currentItem is of Content Type &quot;ABC&quot;. SharePoint will call ItemTemplate for each Item. So for each item we can ContentType with ctx.CurrentItem.ContentType. To get the edit item effect and mouse over effect, we need to consider the ids for each item and the ids are built upon 3 values. ctx.ctxId, ctx.CurrentItem.ID and ctxx.CurrentItemIdx. I am having only one column which is the name of the document. If you want to have more column just copy the html from IE and paste in tr.&lt;br /&gt;
&lt;br /&gt;
Here is the complete itemTemplate function:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;function itemTemplate(ctx){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var defItemTemplate;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var itemId = ctx.ctxId + &quot;,&quot; + ctx.CurrentItem.ID + &quot;,&quot; + ctx.CurrentItemIdx;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (ctx.CurrentItem.ContentType == &quot;ABC&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;var customItemHtml = &#39;&amp;lt;tr class=&quot;ms-alternating ms-itmhover&quot; oncontextmenu=&quot;return ShowCallOutOrECBWrapper(this, event, true)&quot; iid=&quot;&#39; + itemId + &#39;&quot; id=&quot;&#39; + itemId + &#39;&quot;&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&amp;nbsp;&#39;&amp;lt;td class=&quot;ms-cellStyleNonEditable ms-vb-itmcbx ms-vb-imgFirstCell&quot; tabindex=0&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&#39;&amp;lt;div role=&quot;checkbox&quot; class=&quot;s4-itm-cbx s4-itm-imgCbx&quot; tabindex=&quot;-1&quot;&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&#39;&amp;lt;span class=&quot;s4-itm-imgCbx-inner&quot;&amp;gt;&lt;span class=&quot;ms-selectitem-span&quot;&gt;&#39; +&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&#39;&amp;lt;img class=&quot;ms-selectitem-icon&quot; alt=&quot;&quot; src=&quot;/_layouts/15/images/spcommon.png?rev=23&quot;/&amp;gt;&#39; +&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;&amp;lt;/span&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&#39;&amp;lt;/span&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&#39;&amp;lt;/div&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&#39;&amp;lt;/td&amp;gt;&#39; +&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&#39;&amp;lt;td class=&quot;ms-cellstyle ms-vb-icon&quot;&amp;gt;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; customItemHtml += &#39;&amp;lt;img width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; alt=&quot;&#39; + ctx.CurrentItem.FileLeafRef + &#39;&quot; title=&quot;&#39; + ctx.CurrentItem.FileLeafRef + &#39;&quot; src=&quot;/_layouts/15/images/&#39; + ctx.CurrentItem[&quot;IconOverlay.mapico&quot;] + &#39;&quot;/&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; customItemHtml += &#39;&amp;lt;img width=&quot;16&quot; height=&quot;16&quot; src=&quot;/_layouts/15/images/&#39; + ctx.CurrentItem.IconOverlay.substring(2) + &#39;&quot; class=&quot;ms-vb-icon-overlay&quot; alt=&quot;&quot; title=&quot;&quot; /&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;customItemHtml += &#39;&amp;lt;/td&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;td colspan=&quot;&#39; + infoTextColSpan + &#39;&quot; class=&quot;ms-cellstyle ms-vb-title&quot; IsECB=&quot;TRUE&quot; IsCallOut=&quot;TRUE&quot; height=&quot;100%&quot;&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;div class=&quot;ms-vb &amp;nbsp;itx&quot; CTXName=&quot;ctx6&quot; id=&quot;60&quot; App=&quot;&quot;&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;a class=&quot;ms-listlink&quot; href=&quot;&#39; + ctx.CurrentItem.FileRef + &#39;&quot; onmousedown=&quot;return VerifyHref(this,event,&quot;1&quot;,&quot;SharePoint.OpenDocuments&quot;,&quot;&quot;&quot;&quot;)&quot; onclick=&quot;return DispEx(this,event,&quot;TRUE&quot;,&quot;FALSE&quot;,&quot;FALSE&quot;,&quot;&quot;,&quot;1&quot;,&quot;SharePoint.OpenDocuments&quot;,&quot;SharePoint.Link&quot;,&quot;&quot;,&quot;&quot;,&quot;18&quot;,&quot;0&quot;,&quot;0&quot;,&quot;0x7fffffffffffffff&quot;)&quot;&amp;gt;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; customItemHtml += &amp;nbsp;ctx.CurrentItem.FileLeafRef&amp;nbsp;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;/a&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;/div&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;/td&amp;gt;&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;customItemHtml += &#39;&amp;lt;/tr&amp;gt;&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;defItemTemplate = customItemHtml;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;defItemTemplate = RenderItemTemplate(ctx);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return defItemTemplate;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have to start with &amp;lt;tr&amp;gt; since Shrepoint renders Header template in &amp;lt;table&amp;gt;&amp;lt;tr&amp;gt; and it continues for itemTemplate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are many more examples in links referenced at the end of this post.&lt;br /&gt;
&lt;br /&gt;
I would post all references which I used to learn here:&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;br /&gt;
1. &lt;a href=&quot;http://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a&quot; target=&quot;_blank&quot;&gt;http://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a&lt;/a&gt;&lt;br /&gt;
2.&lt;a href=&quot;http://blog.vgrem.com/2013/04/14/customize-the-rendering-of-a-list-view-in-sharepoint-2013-displaying-list-items-in-accordion/&quot; target=&quot;_blank&quot;&gt;http://blog.vgrem.com/2013/04/14/customize-the-rendering-of-a-list-view-in-sharepoint-2013-displaying-list-items-in-accordion/&lt;/a&gt;&lt;br /&gt;
3.&amp;nbsp;&lt;a href=&quot;http://www.lestersconyers.com/custom-field-rendering-with-jslink/&quot; target=&quot;_blank&quot;&gt;http://www.lestersconyers.com/custom-field-rendering-with-jslink/&lt;/a&gt;&lt;br /&gt;
4.&amp;nbsp;&lt;a href=&quot;http://mysharepointwork.blogspot.de/2013/06/sharepoint-2013-jslink-examples-and.html&quot; target=&quot;_blank&quot;&gt;http://mysharepointwork.blogspot.de/2013/06/sharepoint-2013-jslink-examples-and.html&lt;/a&gt;&lt;br /&gt;
5.&amp;nbsp;&lt;a href=&quot;http://ravtec.blogspot.de/2013/09/tiles-view-with-client-side-rendering.html&quot; target=&quot;_blank&quot;&gt;http://ravtec.blogspot.de/2013/09/tiles-view-with-client-side-rendering.html&lt;/a&gt;&lt;br /&gt;
6.&amp;nbsp;&lt;a href=&quot;http://www.slideshare.net/chrisobrien/customizing-the-sharepoint-2013-user-interface-with-javascript-chris-obrien&quot; target=&quot;_blank&quot;&gt;http://www.slideshare.net/chrisobrien/customizing-the-sharepoint-2013-user-interface-with-javascript-chris-obrien&lt;/a&gt;&lt;br /&gt;
7.&amp;nbsp;&lt;a href=&quot;http://blog-aspc.azurewebsites.net/display-templates-in-sharepoint-2013/&quot; target=&quot;_blank&quot;&gt;http://blog-aspc.azurewebsites.net/display-templates-in-sharepoint-2013/&lt;/a&gt;&lt;br /&gt;
8.&amp;nbsp;&lt;a href=&quot;http://www.rbradbrook.co.uk/Blog/Post/10/Introduction-to-Client-Side-Rendering-in-SharePoint-2013&quot; target=&quot;_blank&quot;&gt;http://www.rbradbrook.co.uk/Blog/Post/10/Introduction-to-Client-Side-Rendering-in-SharePoint-2013&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/3882157381622278366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/3882157381622278366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/3882157381622278366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/3882157381622278366'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/showingstyle-specific-content-type.html' title='Showing/Style specific Content Type Items with JSLink in SharePoint 2013'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7857380596404908541</id><published>2014-01-15T00:31:00.001-08:00</published><updated>2014-01-15T00:32:54.503-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="operation could not be completed because the item was removed from the gallery sharepoint 2013"/><title type='text'>operation could not be completed because the item was removed from the gallery sharepoint 2013</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I got this error message when I am trying to add a new web part to a page. Before this, I did the following:
&lt;br/&gt;
&lt;br/&gt;
1. Retract WSP File&lt;br/&gt;
2. Deploy WSP File&lt;br/&gt;
3. Try to add web parts to the Page&lt;br/&gt;
&lt;br/&gt;

The old references are there in gallery but the web parts are not really there. Same thing happened with JavaScript files. The files are there in Style Library but when I open them I get File Not Found error. 
&lt;br/&gt;&lt;br/&gt;

&lt;b&gt;FIX:&lt;/b&gt;&lt;br/&gt;
I manually removed the Web Parts from Web Part gallery and Java scripts from Style Library. Deactivate and activate the feature.&lt;br/&gt; 


&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7857380596404908541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7857380596404908541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7857380596404908541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7857380596404908541'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/operation-could-not-be-completed.html' title='operation could not be completed because the item was removed from the gallery sharepoint 2013'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-5451249397883167975</id><published>2014-01-14T07:17:00.000-08:00</published><updated>2014-01-14T07:17:19.119-08:00</updated><title type='text'>Exam 70-486 Study Material Developing ASP.NET MVC 4 Web Applications</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
References:&lt;br /&gt;
&lt;br /&gt;
1. In this Blog, Chris has nicely guided for the topics in the exam.&lt;br /&gt;
&lt;a href=&quot;http://www.bloggedbychris.com/2012/11/06/microsoft-exam-70-486-study-guide/&quot; target=&quot;_blank&quot;&gt;http://www.bloggedbychris.com/2012/11/06/microsoft-exam-70-486-study-guide/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2. Another Study Material with links to reference resources
&lt;br/&gt; &lt;a href=&quot;http://geekswithblogs.net/WTFNext/archive/2013/05/29/exam-70-486-study-material-developing-asp.net-mvc-4-web-applications.aspx&quot; target=&quot;_blank&quot;&gt;http://geekswithblogs.net/WTFNext/archive/2013/05/29/exam-70-486-study-material-developing-asp.net-mvc-4-web-applications.aspx&lt;/a&gt;&lt;br/&gt;
3. &lt;a href=&quot;http://www.asp.net/mvc/tutorials/mvc-4&quot; target=&quot;_blank&quot;&gt;http://www.asp.net/mvc/tutorials/mvc-4&lt;/a&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/5451249397883167975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/5451249397883167975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/5451249397883167975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/5451249397883167975'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/exam-70-486-study-material-developing.html' title='Exam 70-486 Study Material Developing ASP.NET MVC 4 Web Applications'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-3829476504787459022</id><published>2014-01-14T06:55:00.002-08:00</published><updated>2014-01-17T05:17:44.987-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CAML Query to search on URL field in SharePoint"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Object MOdel"/><title type='text'>CAML Query to search on URL field in SharePoint</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I had done similar query several times, every time it comes with different problems. The following are the reasons for it.&lt;br /&gt;
&lt;br /&gt;
1. Encode the Name of file if it has spaces.&lt;br /&gt;
2. URL field is stored as [URL],[Description]&lt;br /&gt;
&lt;br /&gt;
If you want to retrieve items based on URL field, you have to use &amp;lt;FieldRef&amp;gt; operator instead &amp;lt;eq&amp;gt;. Since &amp;lt;eq&amp;gt; matches for the complete URL, you will get empty results back.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
If URL field is stored with serverRelativeURL, you can use &amp;lt;BeginsWith&amp;gt; too. In my case, I had to use &amp;lt;contains&amp;gt; since we save URL field with Absolute URLs.&lt;br /&gt;
&lt;br /&gt;
This is how I used for my query:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
SPQuery query = new SPQuery();&lt;br/&gt;
query.Query =&quot;&lt;Where&gt;&lt;Contains&gt;&lt;FieldRef Name=&#39;URL&#39;&gt;&lt;Value Type=&#39;URL&#39;&gt;&quot;+ urlParameter +&quot;&lt;/Value&gt;&lt;/FieldRef&gt;&lt;/Contains&gt;&lt;/Where&gt;&quot;;


//get the results
SPListItemCollection result = list.GetItems(query);
&lt;/div&gt;
Here the urlVal can be either Absolute or relative url.
If the fileName has spaces then use &lt;br/&gt;
&lt;div class=&quot;code&quot;&gt;
SPEncode.UrlEncodeAsUrl(fileName); 
&lt;/div&gt;

SPEncode.UrlEncodeAsUrl() encodes only the spaces with %20.
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/3829476504787459022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/3829476504787459022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/3829476504787459022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/3829476504787459022'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/caml-query-to-search-on-url-field-in.html' title='CAML Query to search on URL field in SharePoint'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-8935338915409550158</id><published>2014-01-13T15:49:00.000-08:00</published><updated>2014-01-14T02:16:49.513-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ListFormWebPart.JSLink"/><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint 2013 JSLink"/><category scheme="http://www.blogger.com/atom/ns#" term="SPForm.JSLink"/><category scheme="http://www.blogger.com/atom/ns#" term="SPForm.JSLink does not updated"/><category scheme="http://www.blogger.com/atom/ns#" term="Update SPForm JSLInk"/><title type='text'>Add/Update SPForm JSlink Programmatically in Sharepoint 2013</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was trying to update the Display Form of DocumentsLibrary. Even though Sharepoint Object supports it and MSDN article says it too, it does not work. I debugged the code, I get always SPForm.JSLink as null and when I try to update the value it does not even updated. I also performed SPDocumentLibrary.Update().&lt;br /&gt;
&lt;br /&gt;
Here is the sample code which I tried:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SPForm form = this.DocumentsLibrary.Forms[PAGETYPE.PAGE_DISPLAYFORM];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((String.IsNullOrEmpty(form.JSLink)) || (form.JSLink.IndexOf(fileName) == -1))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; form.JSLink += String.Format(CultureInfo.InvariantCulture, &quot;{0}|~sitecollection/Style Library/{1}&quot;, form.JSLink,&amp;nbsp;fileName);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
I see several posts saying that it will work. But it does not work for me and saw lot of people are having same issue.&lt;br /&gt;
&lt;br /&gt;
If there is work around, it would be great if any one shares it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;UPDATE:&lt;/b&gt;&lt;br /&gt;
We have tried to make the update via PowerShell, it&#39;s also does not help.&lt;br /&gt;
&lt;br /&gt;
Here is my work around which worked for me. Using DispFormUrl, I got the page and retrieve ListFormWebPart and set the property JSLink to the ListFormWebPart.&lt;br /&gt;
&lt;br /&gt;
Example is below:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; SPForm form = this.DocLib.Forms[PAGETYPE.PAGE_DISPLAYFORM];&lt;br /&gt;
&amp;nbsp; string&amp;nbsp;formUrl= form.Url;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;SPFile page = this.web.GetFile(formUrl);&lt;br /&gt;
&amp;nbsp;using (SPLimitedWebPartManager wpManager = page.GetLimitedWebPartManager(PersonalizationScope.Shared))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Enable the Update&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wpManager.Web.AllowUnsafeUpdates = true;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Check out the file, if not checked out&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SPFile file = wpManager.Web.GetFile(dispFormUrl);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (file.CheckOutType == SPFile.SPCheckOutType.None)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file.CheckOut();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Find the ListFormWebPart and Update the Template Name Property&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (System.Web.UI.WebControls.WebParts.WebPart webpart in wpManager.WebParts)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (webpart is Microsoft.SharePoint.WebPartPages.ListFormWebPart)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Microsoft.SharePoint.WebPartPages.ListFormWebPart listFormWebPart =&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Microsoft.SharePoint.WebPartPages.ListFormWebPart)webpart.WebBrowsableObject;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; listFormWebPart.TemplateName = &quot;ListForm&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((String.IsNullOrEmpty(listFormWebPart.JSLink)) || (listFormWebPart.JSLink.IndexOf(fileName) == -1))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; listFormWebPart.JSLink += String.Format(CultureInfo.InvariantCulture, &quot;{0}|~sitecollection/Style Library/{1}&quot;, listFormWebPart.JSLink, fileName);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wpManager.SaveChanges(listFormWebPart);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Update the file&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file.Update();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; file.CheckIn(&quot;System Update&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Disable the Unsafe Update&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wpManager.Web.AllowUnsafeUpdates = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finally&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (wpManager.Web != null)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; wpManager.Web.Dispose();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/8935338915409550158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/8935338915409550158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8935338915409550158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8935338915409550158'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/addupdate-jslink-for-spform.html' title='Add/Update SPForm JSlink Programmatically in Sharepoint 2013'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-6945167021081836250</id><published>2014-01-07T13:58:00.001-08:00</published><updated>2014-01-14T04:07:04.162-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="70-480 Exam"/><category scheme="http://www.blogger.com/atom/ns#" term="MCSD Start Exam"/><category scheme="http://www.blogger.com/atom/ns#" term="Preparation fr 70-480 Exam"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming in HTML5 with JavaScript and CSS3 Exam"/><title type='text'>Preparation for 70-480 Exam or Programming in HTML5 with JavaScript and CSS3 Exam</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Last December I finished my 70-576 exam, now I started preparing for 70-480 Exam for MCSD. I am posting here all my references and book information which may help others as well. The following are the links: &lt;br /&gt;
&lt;br /&gt;
The topics or Syllabus is here: &lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/learning/en-us/exam-70-480.aspx?c=de&quot; target=&quot;_blank&quot;&gt;http://www.microsoft.com/learning/en-us/exam-70-480.aspx?c=de&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference Links:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
In the below link Microsoft offers Virtual Training with videos and sample questions also you can answer as part of preparation:&lt;br /&gt;
1. &lt;a href=&quot;http://www.microsoftvirtualacademy.com/Content/ViewContent.aspx?et=1949&amp;amp;m=1943&amp;amp;ct=13936#?fbid=yi5M9XUzy9C&quot; target=&quot;_blank&quot;&gt;Video Training from MVA&lt;/a&gt;&lt;br /&gt;
2. &lt;a href=&quot;http://www.microsoft.com/web/post/get-started-using-html5?sf1284466=1&quot; target=&quot;_blank&quot;&gt;http://www.microsoft.com/web/post/get-started-using-html5?sf1284466=1&lt;/a&gt;&lt;br /&gt;
3. &lt;a href=&quot;http://borntolearn.mslearn.net/certification/developer/f/528/t/322309.aspx#fbid=Km0BLSd3nmq&quot; target=&quot;_blank&quot;&gt;70-480 Exam Forum&lt;/a&gt;&lt;br /&gt;
4. &lt;a href=&quot;http://www.w3schools.com/jsref/dom_obj_frame.asp&quot; target=&quot;_blank&quot;&gt;http://www.w3schools.com/jsref/dom_obj_frame.asp&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/6945167021081836250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/6945167021081836250' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6945167021081836250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6945167021081836250'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2014/01/preparation-for-70-480-exam-or.html' title='Preparation for 70-480 Exam or Programming in HTML5 with JavaScript and CSS3 Exam'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-1458910846397142777</id><published>2013-09-25T03:32:00.001-07:00</published><updated>2013-09-25T03:32:43.062-07:00</updated><title type='text'>Activate and Deactivate Sharepoint Features using Client Object Model</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Sample Code is here:

&lt;div class=&quot;code&quot;&gt;
  function GenerateProjectSite(obj) {&lt;br/&gt;
            var featureGuid = &quot;{XXXXX-XXXX-XXXX-XXXX-XXXXX}&quot;;&lt;br/&gt;
            DeactivateFeature(featureGuid);&lt;br/&gt;
            ActivateFeature(featureGuid);&lt;br/&gt;
        }&lt;br/&gt;
&lt;br/&gt;&lt;br/&gt;
        function DeactivateFeature(featureGuid) {&lt;br/&gt;
            var relativeUrl = _spPageContextInfo.siteServerRelativeUrl();&lt;br/&gt;
            $.getScript(relativeUrl + &quot;_layouts/15/sp.runtime.js&quot;, function () {&lt;br/&gt;
                $.getScript(relativeUrl + &#39;_layouts/15/sp.js&#39;, function () {&lt;br/&gt;
                    $.getScript(relativeUrl + &#39;_layouts/15/sp.publishing.js&#39;, function () {&lt;br/&gt;
&lt;br/&gt;
                        var clientContext = new SP.ClientContext.get_current();&lt;br/&gt;
                        var web = clientContext.get_web();&lt;br/&gt;
                        var guid = new SP.Guid(featureGuid);&lt;br/&gt;
                        var featDef = web.get_features().remove(featureGuid, true);&lt;br/&gt;
                        clientContext.executeQueryAsync(Function.createDelegate(this, this.OnSuccess), Function.createDelegate(this, this.OnFail));&lt;br/&gt;

                    });&lt;br/&gt;
                });&lt;br/&gt;
            });&lt;br/&gt;
        }&lt;br/&gt;
&lt;br/&gt;&lt;br/&gt;
        function ActivateFeature(featureGuid) {&lt;br/&gt;
            var relativeUrl =  _spPageContextInfo.siteServerRelativeUrl();&lt;br/&gt;
            $.getScript(relativeUrl + &quot;_layouts/15/sp.runtime.js&quot;, function () {&lt;br/&gt;
                $.getScript(relativeUrl + &#39;_layouts/15/sp.js&#39;, function () {&lt;br/&gt;
&lt;br/&gt;
                    var clientContext = new SP.ClientContext.get_current();&lt;br/&gt;
                    var web = clientContext.get_web();&lt;br/&gt;
                    var guid = new SP.Guid(featureGuid);&lt;br/&gt;
                    var featDef = web.get_features().add(featureGuid, false, SP.FeatureDefinitionScope.farm);&lt;br/&gt;
                    clientContext.executeQueryAsync(Function.createDelegate(this, this.OnSuccess), Function.createDelegate(this, this.OnFail));&lt;br/&gt;
&lt;br/&gt;
                });&lt;br/&gt;
            });&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;
        function OnSuccess(sender, args) {&lt;br/&gt;
            console.log(&quot;Success!&quot;);&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;
        function OnFail(sender, args) {&lt;br/&gt;
           console.log(&quot;Fail: &quot; + args.get_message() + &quot;\n&quot; + args.get_stackTrace());&lt;br/&gt;
}&lt;br/&gt;&lt;br/&gt;
&lt;/div&gt;

&lt;br/&gt;
&lt;b&gt;References:&lt;/b&gt;&lt;br/&gt;
&lt;a href=&quot;http://social.technet.microsoft.com/Forums/sharepoint/en-US/d063e579-8cbe-4522-8c1e-eec83329a12b/how-to-activate-a-feature-from-client-om&quot; target=&quot;_blank&quot;&gt;Discussion Thread&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://www.learningsharepoint.com/2010/07/09/activate-feature-with-client-object-model-sharepoint-2010/&quot; target=&quot;_blank&quot;&gt;http://www.learningsharepoint.com/2010/07/09/activate-feature-with-client-object-model-sharepoint-2010/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://community.zevenseas.com/Blogs/Tanmay/Lists/Posts/Post.aspx?ID=11&quot; target=&quot;_blank&quot;&gt;http://community.zevenseas.com/Blogs/Tanmay/Lists/Posts/Post.aspx?ID=11&lt;/a&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/1458910846397142777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/1458910846397142777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/1458910846397142777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/1458910846397142777'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/09/activate-and-deactivate-sharepoint.html' title='Activate and Deactivate Sharepoint Features using Client Object Model'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-8226961429179081408</id><published>2013-09-05T13:51:00.001-07:00</published><updated>2013-09-05T13:51:58.970-07:00</updated><title type='text'>Enable Audience Targeting for Sharepoint Quick Launch Menu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here I am posting some of references I have found:
&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;References:&lt;/b&gt;&lt;br/&gt;
&lt;a href=&quot;http://weblogs.asp.net/jhallal/archive/2011/06/22/sharepoint-navigation-setting-the-audience-property-of-an-spnavigationnode.aspx&quot; target=&quot;_blank&quot;&gt;http://weblogs.asp.net/jhallal/archive/2011/06/22/sharepoint-navigation-setting-the-audience-property-of-an-spnavigationnode.aspx&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://social.msdn.microsoft.com/Forums/sharepoint/en-US/fc046128-ba01-4205-965e-bce3fc24d55d/add-audience-to-a-linkspnavigationnode-with-c&quot; target=&quot;_blank&quot;&gt;http://social.msdn.microsoft.com/Forums/sharepoint/en-US/fc046128-ba01-4205-965e-bce3fc24d55d/add-audience-to-a-linkspnavigationnode-with-c&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0b1539ba-2a3a-47f5-b243-7a71c1da0a6a/showhide-link-in-quick-launch-menu-for-a-user-group-programmatically&quot; target=&quot;_blank&quot;&gt;http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0b1539ba-2a3a-47f5-b243-7a71c1da0a6a/showhide-link-in-quick-launch-menu-for-a-user-group-programmatically&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://social.msdn.microsoft.com/Forums/en-US/0d2476b4-0547-4a32-aaa7-ed15cfd4a247/assign-target-audience-to-quicklunch-link-in-sharepoint-designer-2010&quot; target=&quot;_blank&quot;&gt;http://social.msdn.microsoft.com/Forums/en-US/0d2476b4-0547-4a32-aaa7-ed15cfd4a247/assign-target-audience-to-quicklunch-link-in-sharepoint-designer-2010&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://sladescross.wordpress.com/2010/12/04/set-the-audience-of-a-navigation-node/&quot; target=&quot;_blank&quot;&gt;http://sladescross.wordpress.com/2010/12/04/set-the-audience-of-a-navigation-node/&lt;/a&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/8226961429179081408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/8226961429179081408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8226961429179081408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8226961429179081408'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/09/enable-audience-targeting-for.html' title='Enable Audience Targeting for Sharepoint Quick Launch Menu'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-9066844900169708315</id><published>2013-08-30T15:33:00.003-07:00</published><updated>2013-09-25T03:30:37.074-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Enable Target Audience programmatically in Sharepoint"/><title type='text'>How to Enable Target Audiences for a List Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I am just posting the sample code for enabling Target Audience for a specific list:
&lt;br/&gt;


&lt;div class=&quot;code&quot;&gt;
      private static SPField GetTargetingField(SPList list)
      {&lt;br/&gt;
          SPField field = null;&lt;br/&gt;
          try 
          {&lt;br/&gt;
              field = list.Fields[new Guid(&quot;61cbb965-1e04-4273-b658-eedaa662f48d&quot;)];&lt;br/&gt;
          }&lt;br/&gt;
          catch (ArgumentException)
         {
         }&lt;br/&gt;
         return field;&lt;br/&gt;
      }&lt;br/&gt;
        
     &lt;br/&gt;
      private static string CreateFieldAsXml()
      {&lt;br/&gt;
         XmlElement element = new XmlDocument().CreateElement(&quot;Field&quot;);&lt;br/&gt;
         element.SetAttribute(&quot;ID&quot;, &quot;61cbb965-1e04-4273-b658-eedaa662f48d&quot;);&lt;br/&gt;
         element.SetAttribute(&quot;Type&quot;, &quot;TargetTo&quot;);&lt;br/&gt;
         element.SetAttribute(&quot;Name&quot;, &quot;TargetTo&quot;);&lt;br/&gt;
         element.SetAttribute(&quot;DisplayName&quot;, &quot;Target Audiences&quot;);&lt;br/&gt;
         element.SetAttribute(&quot;Required&quot;, &quot;FALSE&quot;);&lt;br/&gt;
        return element.OuterXml;&lt;br/&gt;
      }&lt;br/&gt;
&lt;br/&gt;
      
        public void EnableTargetAudience(string webUrl)
        {          &lt;br/&gt;
            using (SPSite site = new SPSite(webUrl))
            {&lt;br/&gt;
                using (SPWeb web = site.OpenWeb()) 
                {&lt;br/&gt;
                    SPList list = web.Lists[&quot;listName&quot;];&lt;br/&gt;
                    string url = web.Url + &quot;/listName&quot;;&lt;br/&gt;
&lt;br/&gt;
                    SPField targetingField = GetTargetingField(list);&lt;br/&gt;
                    if (targetingField == null)
                    {&lt;br/&gt;
                        string createFieldAsXml = CreateFieldAsXml();&lt;br/&gt;
                        list.Fields.AddFieldAsXml(createFieldAsXml);&lt;br/&gt;
                        list.Update();&lt;br/&gt;
                    }                   &lt;br/&gt;
                }&lt;br/&gt;
            }         &lt;br/&gt;  
        }&lt;br/&gt;
&lt;br/&gt;
&lt;/div&gt;

If you looking for enabling target audience for custom content type then please go through the references provided below.
&lt;br/&gt;

&lt;b&gt;References:&lt;/b&gt;&lt;br/&gt;
&lt;a href=&quot;http://blog.falchionconsulting.com/index.php/2008/08/enabling-audience-targeting-on-a-list/&quot;&gt;http://blog.falchionconsulting.com/index.php/2008/08/enabling-audience-targeting-on-a-list/&lt;/a&gt;
&lt;a href=&quot;http://maulikdhorajia.blogspot.de/2011/09/sharepoint-2010-enabling-target.html&quot;&gt;http://maulikdhorajia.blogspot.de/2011/09/sharepoint-2010-enabling-target.html&lt;/a&gt;


&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/9066844900169708315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/9066844900169708315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/9066844900169708315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/9066844900169708315'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/how-to-enable-target-audiences-for-list.html' title='How to Enable Target Audiences for a List Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7058895081566674920</id><published>2013-08-30T14:10:00.000-07:00</published><updated>2013-09-25T03:25:51.827-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delete all webparts from Sharepoint Page Programmatically"/><title type='text'>Programmatically delete/remove all webparts from Sharepoint Page</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I created a Sharepoint Page where webparts are provisioned. Everytime, when the feature is activated duplicates are adding to the Page. I wanted to get rid of the webparts on FestureDeactivating. I found a nice article which helped me to delete all webparts on FeatureDeactivating. Below is the piece of code: I called the below method from my FeatureDeactivating method

&lt;div class=&quot;code&quot;&gt;
   public void RemoveAllWebParts(string webUrl)&lt;br/&gt;
        {&lt;br/&gt;
            using (SPSite site = new SPSite(webUrl))
            {&lt;br/&gt;
                using (SPWeb web = site.OpenWeb())
                {&lt;br/&gt;
                    web.AllowUnsafeUpdates = true;&lt;br/&gt;
                    string url = String.Format(&quot;{0}{1}&quot;, web.ServerRelativeUrl.ToString(), &quot;sample.aspx&quot;);  &lt;b&gt;// This is my Page where I want to delete webparts&lt;/b&gt;&lt;br/&gt;
                    SPFile pageFile = web.GetFile(url );&lt;br/&gt;
&lt;br/&gt;
                    using (SPLimitedWebPartManager wpManager = pageFile.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared))
                    {&lt;br/&gt;
                        List&lt;Microsoft.SharePoint.WebPartPages.WebPart&gt; webParts = new List&lt;Microsoft.SharePoint.WebPartPages.WebPart&gt;();&lt;br/&gt;
                        foreach (Microsoft.SharePoint.WebPartPages.WebPart webPart in wpManager.WebParts)
                        {&lt;br/&gt;
                            webParts.Add(webPart);&lt;br/&gt;
                        }&lt;br/&gt;
&lt;br/&gt;
                        foreach (Microsoft.SharePoint.WebPartPages.WebPart webPart in webParts)
                        {&lt;br/&gt;
                            wpManager.DeleteWebPart(webPart);&lt;br/&gt;
                        }                    &lt;br/&gt;
                        &lt;br/&gt;
                    }&lt;br/&gt;
                    web.AllowUnsafeUpdates = false;&lt;br/&gt;
                    web.Update();&lt;br/&gt;
                }&lt;br/&gt;
            }&lt;br/&gt;
        }&lt;br/&gt;
&lt;br/&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;b&gt;UPDATE:&lt;/b&gt;
&lt;br/&gt;
The above code worked for me some time, all of a sudden I am started getting Unable to cast type XXXX to Micrososft.SharePoint.WebPartPages.WebPart. &lt;br/&gt;
I found that you can use System.Web.UI.WebControls.WebParts.WebPart instead of Micrososft.SharePoint.WebPartPages.WebPart.  Also you have to change the List from List&lt;Micrososft.SharePoint.WebPartPages.WebPart&gt; to List&lt;System.Web.UI.WebControls.WebParts.WebPart&gt; 

&lt;br/&gt;
&lt;br/&gt;
There are some other methods to remove webparts from Sharepoint Page. If you want to have a look, go through the references.&lt;br/&gt;&lt;br/&gt;
&lt;b&gt;References:&lt;/b&gt;&lt;br/&gt;
&lt;a href=&quot;http://platinumdogs.me/2009/08/10/removing-provisioned-files-from-sharepoint-during-feature-deactivation/&quot; target=&quot;_blank&quot;&gt;http://platinumdogs.me/2009/08/10/removing-provisioned-files-from-sharepoint-during-feature-deactivation/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://blog.mastykarz.nl/preventing-provisioning-duplicate-web-parts-instances-on-feature-reactivation/&quot; target=&quot;_blank&quot;&gt;http://blog.mastykarz.nl/preventing-provisioning-duplicate-web-parts-instances-on-feature-reactivation/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://curia.me/post/2012/09/10/SharePoint-preventing-duplicate-web-parts.aspx&quot; target=&quot;_blank&quot;&gt;http://curia.me/post/2012/09/10/SharePoint-preventing-duplicate-web-parts.aspx&lt;/a&gt;


&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7058895081566674920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7058895081566674920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7058895081566674920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7058895081566674920'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/programmatically-deleteremove-all.html' title='Programmatically delete/remove all webparts from Sharepoint Page'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7984972344991539718</id><published>2013-08-30T13:29:00.002-07:00</published><updated>2013-08-30T13:29:51.945-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint 2013 Promoted Links List as ListViewWebPart Programmatically"/><title type='text'>Create/Add Sharepoint 2013 Promoted Links List as List View Webpart Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today morning, I was trying to add Sharepoint 2013 Promoted Links list with Tiles View as List View WebPart programmatically. I was not successful as I tried with ListViewWebPart with Object Model. I found out that we have to use XsltListViewWebPart which worked without problems. Here is piece of code which created the Tiles view of Links. 
&lt;br/&gt;

&lt;div class=&quot;code&quot;&gt;
  string linksListId = String.Format(&quot;g_{0}&quot;, Guid.NewGuid().ToString().Replace(&#39;-&#39;, &#39;_&#39;)); &lt;br/&gt;                       
  XsltListViewWebPart linksWp = new XsltListViewWebPart();&lt;br/&gt;
  linksWp.ID = linksListId ;&lt;br/&gt;
  linksWp.Title = &quot;Promoted Links&quot;;&lt;br/&gt;
  string linksListServerRelativeUrl = web.ServerRelativeUrl + &quot;/mylinks&quot;;&lt;br/&gt;
&lt;br/&gt;
  SPList linksList = web.GetList(linksListServerRelativeUrl); &lt;br/&gt;        
  linksWp.Width = &quot;600&quot;;            &lt;br/&gt;
  linksWp.ListId = linksList.ID;&lt;br/&gt;
  linksWp.ViewGuid = linksList.Views[&quot;Tiles&quot;].ID.ToString(&quot;B&quot;).ToUpper();&lt;br/&gt;
&lt;br/&gt;
  wpManager.AddWebPart(linksWp, &quot;MiddleLeft&quot;, 1);&lt;br/&gt;
  wpManager.SaveChanges(linksWp);&lt;br/&gt;
&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7984972344991539718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7984972344991539718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7984972344991539718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7984972344991539718'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/createadd-sharepoint-2013-promoted.html' title='Create/Add Sharepoint 2013 Promoted Links List as List View Webpart Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-6000899158159051437</id><published>2013-08-28T08:10:00.002-07:00</published><updated>2013-08-28T08:10:13.787-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="create publishing page programatically"/><title type='text'>Creating Publishing Page based on PageLayout</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;div class=&quot;code&quot;&gt;
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(freshWeb);&lt;br/&gt;
PageLayout[] pageColl = pubWeb.GetAvailablePageLayouts(ctId); // the ContentTypeId of the ContentType you used to create your pagelayout&lt;br/&gt;

PageLayout selectedLayout = null;&lt;br/&gt;

// Since there might be more pagelayouts attached to our contenttype we have to select it by title&lt;br/&gt;
foreach (PageLayout pl in pageColl)&lt;br/&gt;
{&lt;br/&gt;
 if (pl.Title == &quot;My PageLayout Title&quot;)&lt;br/&gt;
        {&lt;br/&gt;
         selectedLayout = pl;&lt;br/&gt;
                break;&lt;br/&gt;
        }&lt;br/&gt;
}&lt;br/&gt;
&lt;br/&gt;
PublishingPage pp = pubWeb.AddPublishingPage(&quot;overview.aspx&quot;, selectedLayout);&lt;br/&gt;
pp.Title = &quot;Example&quot;; &lt;br/&gt;&lt;br/&gt;
pp.ListItem.File.CheckIn(&quot;Created from code&quot;, SPCheckinType.MajorCheckIn);&lt;br/&gt;
&lt;/div&gt;

In the above code if you use &lt;div class=&quot;code&quot;&gt;PageLayout layout = layouts[0];&lt;/div&gt;

then it will always select the First Page Layout.


Referenes:
&lt;br/&gt;
&lt;a href=&quot;http://ammarfassy.wordpress.com/2013/03/31/publishing-pages-based-on-a-sharepoint-article-page-layout-programmatically/&quot; target=&quot;_blank&quot;&gt;http://ammarfassy.wordpress.com/2013/03/31/publishing-pages-based-on-a-sharepoint-article-page-layout-programmatically/&lt;/a&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/6000899158159051437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/6000899158159051437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6000899158159051437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6000899158159051437'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/creating-publishing-page-based-on.html' title='Creating Publishing Page based on PageLayout'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-5558069167231194983</id><published>2013-08-28T08:02:00.002-07:00</published><updated>2013-08-28T08:08:55.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Create SPFile"/><category scheme="http://www.blogger.com/atom/ns#" term="Update SPFile"/><title type='text'>Create SPFile and Update Content in SPFile Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently, I have to use this code for every other project. I thought it would be useful for me in the future use and for someone else who looks for the same.

This post gives a sample of how to create SPFile and add content to it and how to delete it before creating it if the file already exists in Sharepoint.

Delete SPFile if already exists
&lt;div class=&quot;code&quot;&gt;
 string htmlDocUrl = webUrl + &quot;/Style%20Library/test.html&quot;;&lt;br/&gt;
 string folderUrl = webUrl + &quot;/Style%20Library/sample folder&quot;;&lt;br/&gt;
 ASCIIEncoding enc = new ASCIIEncoding();&lt;br/&gt;
 byte[] fileContents = null;&lt;br/&gt;
 SPFile file = null;&lt;br/&gt;
 file = web.GetFile(htmlDocUrl);&lt;br/&gt;
 if (file != null &amp;&amp; file.Exists)&lt;br/&gt;
 {&lt;br/&gt;
    file.Delete();&lt;br/&gt;
 }&lt;br/&gt;
&lt;/div&gt;

For deletio of SPFile, I tried to use the following code which has not worked.
&lt;div class=&quot;code&quot;&gt;
   web.AllowUnsafeUpdates = true;&lt;br/&gt;

   web.Files.Delete(htmlDocUrl);&lt;br/&gt;
   web.Update();&lt;br/&gt;
   web.AllowUnsafeUpdates = false;&lt;br/&gt;
     
&lt;/div&gt;

My task was to add some html to the file. So I write html from string and GetBytes() from that string to save the file. I used StringBuilder which looks good for formatting.

&lt;div class=&quot;code&quot;&gt;
 StringBuilder scriptSrc = new StringBuilder();&lt;br/&gt;
 scriptSrc.AppendLine(&quot;&lt;div&gt;hello&lt;/div&gt;&quot;);&lt;br/&gt;

   fileContents = enc.GetBytes(scriptSrc.ToString());&lt;br/&gt;
   file = web.Files.Add(htmlDocUrl, fileContents, true);&lt;br/&gt;
  file.CheckIn(&quot;File added&quot;);&lt;br/&gt;
&lt;/div&gt;
&lt;br/&gt;

&lt;b&gt;NOTE:&lt;/b&gt;&lt;br/&gt; You must CheckIn() the file otherwise it won&#39;t be saved to Sharepoint.

If you have create your file under sub folder then you can simply call &lt;a href=&quot;http://kicktech.blogspot.de/2013/08/create-sub-folder-in-sharepoint.html&quot;&gt;EnsureParentFolder()&lt;/a&gt; (which will create sub folder, you can have the code from my previous post) before web.Files.Add() method.
&lt;div class=&quot;code&quot;&gt;   &lt;a href=&quot;http://kicktech.blogspot.de/2013/08/create-sub-folder-in-sharepoint.html&quot;&gt;EnsureParentFolder(web, htmlDocUrl)&lt;/a&gt;;&lt;/div&gt;
&lt;br/&gt;
&lt;br/&gt;
References:
&lt;a href=&quot;http://elczara.wordpress.com/2008/09/12/programming-sharepoint-library-file/&quot; target=&quot;_blank&quot;&gt;http://elczara.wordpress.com/2008/09/12/programming-sharepoint-library-file/&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd587349(v=office.11).aspx&quot; target=&quot;_blank&quot;&gt;http://msdn.microsoft.com/en-us/library/dd587349(v=office.11).aspx&lt;/a&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/5558069167231194983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/5558069167231194983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/5558069167231194983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/5558069167231194983'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/create-spfile-and-update-content-in.html' title='Create SPFile and Update Content in SPFile Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-6870408340202696028</id><published>2013-08-28T02:26:00.003-07:00</published><updated>2013-08-28T02:30:37.209-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sub Folder in Sharepoint Programmatically"/><title type='text'>Create Sub Folder in Sharepoint Programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here is a sample code create a sub folder in Sharepoint.
&lt;div class=&quot;code&quot;&gt;
 public string EnsureParentFolder(SPWeb parentSite, string destinUrl)&lt;br/&gt;
        {&lt;br/&gt;
            destinUrl = parentSite.GetFile(destinUrl).Url;&lt;br/&gt;

            int index = destinUrl.LastIndexOf(&quot;/&quot;);&lt;br/&gt;
            string parentFolderUrl = string.Empty;&lt;br/&gt;

            if (index &gt; -1)&lt;br/&gt;
            {&lt;br/&gt;
                parentFolderUrl = destinUrl.Substring(0, index);&lt;br/&gt;

                SPFolder parentFolder = parentSite.GetFolder(parentFolderUrl);&lt;br/&gt;

                if (!parentFolder.Exists)&lt;br/&gt;
                {&lt;br/&gt;
                    SPFolder currentFolder = parentSite.RootFolder;&lt;br/&gt;

                    foreach (string folder in parentFolderUrl.Split(&#39;/&#39;))&lt;br/&gt;
                    {&lt;br/&gt;
                        currentFolder = currentFolder.SubFolders.Add(folder);&lt;br/&gt;
                    }&lt;br/&gt;
                }&lt;br/&gt;
            }&lt;br/&gt;
&lt;br/&gt;
            return parentFolderUrl;&lt;br/&gt;
        }&lt;br/&gt;
&lt;/div&gt;

&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/6870408340202696028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/6870408340202696028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6870408340202696028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/6870408340202696028'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/create-sub-folder-in-sharepoint.html' title='Create Sub Folder in Sharepoint Programmatically'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-2805306308241498113</id><published>2013-08-22T07:44:00.003-07:00</published><updated>2013-08-22T07:44:42.990-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sharepoint file icon from Item Url"/><title type='text'>Create Sharepoint File Icon from Item Url</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

I created a list of all documents from sharepoint search and displayed all documents. Then I had to display file icon next to each document. As usual googled for it and found the following piece of code which is very clear.

It is really simple as you can see

&lt;div class=&quot;code&quot;&gt;
protected string getIconUrl(string itemUrl)&lt;br/&gt;
{&lt;br/&gt;
SPWeb web = SPContext.Current.Web;&lt;br/&gt;
string iconUrl = string.Empty;&lt;br/&gt;
iconUrl = web.ServerRelativeUrl + &quot;/_layouts/images/&quot; + SPUtility.MapToIcon(SPContext.Current.Web, itemUrl, string.Empty, IconSize.Size16);&lt;br/&gt;
return iconUrl;&lt;br/&gt;
}&lt;br/&gt;
&lt;/div&gt;
The trick is done by SPUtility.MapToIcon


&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/2805306308241498113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/2805306308241498113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/2805306308241498113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/2805306308241498113'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/create-sharepoint-file-icon-from-item.html' title='Create Sharepoint File Icon from Item Url'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7740544438353053594</id><published>2013-08-21T06:02:00.001-07:00</published><updated>2013-08-21T06:02:48.155-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SPSite Best practices not used"/><category scheme="http://www.blogger.com/atom/ns#" term="Trying to use an SPWeb object that has been closed or disposed and is no longer valid."/><category scheme="http://www.blogger.com/atom/ns#" term="What happens when SPWeb"/><title type='text'>Trying to use an SPWeb object that has been closed or disposed and is no longer valid. </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today I was developing a web control and testing it, all of a sudden I was getting this error: &lt;i&gt;&quot;Trying to use an SPWeb object 
that has been closed or disposed and is no longer valid.&quot;&lt;/i&gt;
&lt;br/&gt;
I was using SPWeb since long time, but never tried how I did today. here is the code that throws exception :
&lt;div class=&quot;code&quot;&gt;
using (SPWeb web = SPContext.Current.Web) 
{
...
}
&lt;/div&gt;
&lt;br/&gt;
we should not use SPContext with using which is mentioned in Best Practices. When we use SPContext, we have to use like below without in using-statement:

&lt;div class=&quot;code&quot;&gt;
SPWeb web = SPContext.Current.Web;
&lt;/div&gt;

Hope this helps for some one else too.
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7740544438353053594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7740544438353053594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7740544438353053594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7740544438353053594'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/trying-to-use-spweb-object-that-has.html' title='Trying to use an SPWeb object that has been closed or disposed and is no longer valid. '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7320405432552373804</id><published>2013-08-21T05:09:00.002-07:00</published><updated>2013-08-21T05:09:19.099-07:00</updated><title type='text'>Get JSON Format from Data Table</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
public string GetJson(DataTable dt)&lt;br /&gt;
{&lt;br /&gt;
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();&lt;br /&gt;
List&lt;dictionary object=&quot;&quot; string=&quot;&quot;&gt; rows = new List&lt;dictionary object=&quot;&quot; string=&quot;&quot;&gt;();&lt;br /&gt;
    Dictionary&lt;string object=&quot;&quot;&gt; row = null;&lt;br /&gt;
&lt;br /&gt;
    foreach (DataRow dr in dt.Rows)&lt;br /&gt;
    {&lt;br /&gt;
        row = new Dictionary&lt;string object=&quot;&quot;&gt;();&lt;br /&gt;
        foreach (DataColumn col in dt.Columns)&lt;br /&gt;
        {&lt;br /&gt;
            row.Add(col.ColumnName.Trim(), dr[col]);&lt;br /&gt;
        }&lt;br /&gt;
        rows.Add(row);&lt;br /&gt;
    }&lt;br /&gt;
    return serializer.Serialize(rows);&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
&lt;/string&gt;&lt;/string&gt;&lt;/dictionary&gt;&lt;/dictionary&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7320405432552373804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7320405432552373804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7320405432552373804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7320405432552373804'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/get-json-format-from-data-table.html' title='Get JSON Format from Data Table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-8961443371715127338</id><published>2013-08-21T04:46:00.001-07:00</published><updated>2013-08-21T04:46:49.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="page"/><category scheme="http://www.blogger.com/atom/ns#" term="scroll up. scroll down"/><title type='text'>Scroll Page up and down using JavaScript / Jquery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
I am posting the code for page scroll up and down. This functionality is useful when you have large pages with lot of content in it, some people frustrated to scroll up and down. The Scroll up and Down buttons on the page will help to go fast up and down.&lt;br /&gt;
&lt;br /&gt;
Here is html of it&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&amp;lt;div class=&quot;nav_up&quot; id=&quot;nav_up&quot; style=&quot;opacity: 1;&quot;&amp;gt;
Scroll Up
&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;nav_down&quot; id=&quot;nav_down&quot; style=&quot;opacity: 1;&quot;&amp;gt;
Scroll Down
&amp;lt;/div&amp;gt;
&lt;/div&gt;
and the JavaScript for the button clicks is here:

&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
              $(function() {&lt;br/&gt;
  var $elem = $(&#39;body&#39;);&lt;br/&gt;
    &lt;br/&gt;
  $(&#39;#nav_up&#39;).fadeIn(&#39;slow&#39;);&lt;br/&gt;
  $(&#39;#nav_down&#39;).fadeIn(&#39;slow&#39;); &lt;br/&gt;
    &lt;br/&gt;
  $(window).bind(&#39;scrollstart&#39;, function(){&lt;br/&gt;
    $(&#39;#nav_up,#nav_down&#39;).stop().animate({&#39;opacity&#39;:&#39;0.2&#39;});&lt;br/&gt;
  });&lt;br/&gt;
  $(window).bind(&#39;scrollstop&#39;, function(){&lt;br/&gt;
    $(&#39;#nav_up,#nav_down&#39;).stop().animate({&#39;opacity&#39;:&#39;1&#39;});&lt;br/&gt;
  });&lt;br/&gt;
   &lt;br/&gt; 
  $(&#39;#nav_down&#39;).click(&lt;br/&gt;
     function (e) {&lt;br/&gt;
        $(&#39;html, body&#39;).animate({scrollTop: $elem.height()}, 800);&lt;br/&gt;
  });&lt;br/&gt;
  $(&#39;#nav_up&#39;).click(&lt;br/&gt;
     function (e) {&lt;br/&gt;
   $(&#39;html, body&#39;).animate({scrollTop: &#39;0px&#39;}, 800);&lt;br/&gt;
   });&lt;br/&gt;
            });&lt;br/&gt;
       &lt;br/&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/8961443371715127338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/8961443371715127338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8961443371715127338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/8961443371715127338'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/scroll-page-up-and-down-using.html' title='Scroll Page up and down using JavaScript / Jquery'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1997439109259893550.post-7287936658041526044</id><published>2013-08-19T05:45:00.001-07:00</published><updated>2013-08-19T05:45:33.339-07:00</updated><title type='text'>&#39;border-bottom&#39; on div appears at top? </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When you float elements, the parent element does not expand to the height of its children unless it is floating its self, or there is another non floating child. Another solution if you cannot float the parent is to add an element after the current children that does not float and clears the other elements. e.g. add this after the inner divs

&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&amp;lt;div style=&quot;clear: both;&quot;/&amp;gt;

&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://kicktech.blogspot.com/feeds/7287936658041526044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1997439109259893550/7287936658041526044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7287936658041526044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1997439109259893550/posts/default/7287936658041526044'/><link rel='alternate' type='text/html' href='http://kicktech.blogspot.com/2013/08/when-you-float-elements-parent-element.html' title='&#39;border-bottom&#39; on div appears at top? '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>