<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>sudhirke</title>
	<atom:link href="http://sudhirke.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sudhirke.wordpress.com</link>
	<description>now this is worth sharing...</description>
	<lastBuildDate>Wed, 19 Oct 2011 14:53:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sudhirke.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>sudhirke</title>
		<link>http://sudhirke.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sudhirke.wordpress.com/osd.xml" title="sudhirke" />
	<atom:link rel='hub' href='http://sudhirke.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MCPD &#8211; SharePoint 2010 Application Development</title>
		<link>http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/</link>
		<comments>http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/#comments</comments>
		<pubDate>Mon, 09 May 2011 08:05:22 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Microsoft Certification]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=118</guid>
		<description><![CDATA[Added MCPD &#8211; SharePoint 2010 Application development to my pool of certifications&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=118&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Added MCPD &#8211; SharePoint 2010 Application development to my pool of certifications&#8230;</p>

<a href='http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/mcpd/' title='MCPD'><img data-attachment-id='119' data-orig-size='322,80' data-liked='0'width="150" height="37" src="http://sudhirke.files.wordpress.com/2011/05/mcpd.png?w=150&#038;h=37" class="attachment-thumbnail" alt="MCPD" title="MCPD" /></a>
<a href='http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/mctsrgb_net/' title='MCTS(rgb)_NET'><img data-attachment-id='120' data-orig-size='374,80' data-liked='0'width="150" height="32" src="http://sudhirke.files.wordpress.com/2011/05/mctsrgb_net.png?w=150&#038;h=32" class="attachment-thumbnail" alt="MCTS(rgb)_NET" title="MCTS(rgb)_NET" /></a>
<a href='http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/mctsrgb_sp/' title='MCTS(rgb)_SP'><img data-attachment-id='121' data-orig-size='505,80' data-liked='0'width="150" height="23" src="http://sudhirke.files.wordpress.com/2011/05/mctsrgb_sp.png?w=150&#038;h=23" class="attachment-thumbnail" alt="MCTS(rgb)_SP" title="MCTS(rgb)_SP" /></a>

<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=118&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/05/09/mcpd-sharepoint-2010-application-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/05/mcpd.png?w=150" medium="image">
			<media:title type="html">MCPD</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/05/mctsrgb_net.png?w=150" medium="image">
			<media:title type="html">MCTS(rgb)_NET</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/05/mctsrgb_sp.png?w=150" medium="image">
			<media:title type="html">MCTS(rgb)_SP</media:title>
		</media:content>
	</item>
		<item>
		<title>MCTS &#8211; SharePoint 2010 Applicaiton Development</title>
		<link>http://sudhirke.wordpress.com/2011/05/03/mcts-sharepoint-2010-applicaiton-development/</link>
		<comments>http://sudhirke.wordpress.com/2011/05/03/mcts-sharepoint-2010-applicaiton-development/#comments</comments>
		<pubDate>Tue, 03 May 2011 06:12:11 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Microsoft Certification]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=113</guid>
		<description><![CDATA[Another feather in my cap, I have completed the first paper in SharePoint 2010 Application Development.  Proud to be in MCTS- SP2010 App Dev certified,  will be taking up the remaining exam soon. Stay tuned<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=113&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another feather in my cap, I have completed the first paper in SharePoint 2010 Application Development.  Proud to be in MCTS- SP2010 App Dev certified,  will be taking up the remaining exam soon.</p>
<p>Stay tuned</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=113&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/05/03/mcts-sharepoint-2010-applicaiton-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery : SharePoint Contact Card Web Part</title>
		<link>http://sudhirke.wordpress.com/2011/02/11/jquery-sharepoint-contact-card-web-part-2/</link>
		<comments>http://sudhirke.wordpress.com/2011/02/11/jquery-sharepoint-contact-card-web-part-2/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 14:49:20 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Lists.asmx]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[SharePoint Web Services]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WSS 3.0]]></category>
		<category><![CDATA[postaweek2011]]></category>
		<category><![CDATA[SharePoint Contact Card]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=101</guid>
		<description><![CDATA[Overview I am back with another jQuery MagicJ. Whenever I was browsing through any social networking site I used to love those beautiful Contact List or Friends list. It was somewhere in the back of my mind to build something &#8230; <a href="http://sudhirke.wordpress.com/2011/02/11/jquery-sharepoint-contact-card-web-part-2/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=101&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>I am back with another jQuery MagicJ. Whenever I was browsing through any social networking site I used to love those beautiful Contact List or Friends list. It was somewhere in the back of my mind to build something like this for our friend SharePoint. Today I got the opportunity to build some fancy (or not so fancy) contact card based on jQuery and SharePoint web services.</p>
<p>The best part of SharePoint is that gives you all the basic infrastructure for your day to day data requirements like Contact List, Task List, Calendar list and so on and once we have place to store such data jQuery gives you the power to read it and present it in the desired format.</p>
<p>Here also I tried something like that and came up with this solution for display contact list data in the card format.</p>
<h3>Download the Code</h3>
<p>Please download the source code and required files from : <a href="https://docs.google.com/leaf?id=0B1XvO-SvpjhGMWE0YzkzYTktNDJiMS00NjIwLTk2MGUtNGVkM2U1YWRhM2E0&amp;sort=name&amp;layout=list&amp;num=50">SudhirKe.jqContactCard.Source.zip</a> in case the google docs link does not work you can download the code from my <a title="GitHub - jQuery Shared" href="https://github.com/sudhirke/jQuery-Shared" target="_blank">GitHub </a>repository.</p>
<p>&nbsp;</p>
<h3>Prerequisites…</h3>
<p>Default contact list from SharePoint. This solution also requires following files:-</p>
<p>- jQuery 1.4.3 [Note: jQuery1.5 is not compatible with SPServices yet.]</p>
<p>- jQuery UI 1.5.9</p>
<p>- jQuery SPServices</p>
<p>- jQuery UI Theme (I have used ui-lightness)</p>
<p>Apart from this I have developed following files:-</p>
<p>- jContactCard.css</p>
<p>- jContactCard.js</p>
<p>If you want to display the person image you can add a image field and get it link to your contact pictures. Other way is to read it from MySite, I have implemented a very basic solution and displayed the default image from SharePoint “/_layouts/images/no_pic.gif” with each contact.</p>
<h3>See it in Action…</h3>
<p>Here is the screen shot of the web part. Moving the mouse over a contact card highlights the contact card (thanks to jQuery UI J)</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image001.jpg"><img class="alignnone size-full wp-image-102" title="image001" src="http://sudhirke.files.wordpress.com/2011/02/image001.jpg?w=593" alt=""   /></a></p>
<h3>The Solution</h3>
<p>I am really sorry for pasting the code as images, but it was getting formatted really badly by WordPress. Anyways I have given the link to download the code.</p>
<h4>CSS File</h4>
<p>CSS code is pretty simple, it just tells to format the contact card details and images etc.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image0091.jpg"><img class="alignnone size-full wp-image-106" title="image0091" src="http://sudhirke.files.wordpress.com/2011/02/image0091.jpg?w=593" alt=""   /></a></p>
<h4>jQuery Code</h4>
<p>It’s very simple like my previous posts. I am using the <a href="http://spservices.codeplex.com/">SPServices</a> solution from CodePlex to read data from SharePoint contact list. Very thanks to <a href="http://www.sharepointoverflow.com/users/82/marc-d-anderson">Marc D Anderson</a>. <em>Marc you have made huge differences to the life of jQuery and SharePoint and jQuery SharePoint lovers like us.</em></p>
<p>So the jQuery code is very oblivious, I am calling SharePoint lists web services using SPServices. I have called “<strong>processResult</strong>” method in the end to parse and format the return values. Below is the code to call the web service:-</p>
<p>Note: The below code can be found in the jContactCard.js file in the code.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image0101.jpg"><img class="alignnone size-full wp-image-107" title="image0101" src="http://sudhirke.files.wordpress.com/2011/02/image0101.jpg?w=593" alt=""   /></a></p>
<p>My processResult method looks something like below:-</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image011.jpg"><img class="alignnone size-full wp-image-108" title="image011" src="http://sudhirke.files.wordpress.com/2011/02/image011.jpg?w=593" alt=""   /></a></p>
<h4>HTML Code</h4>
<p>The required HTML script is really simple, the magical part is already taken care by jQuery all your html needs is a div element with “result” as id. Of course you need to add reference to the required JavaScript and CSS files.</p>
<p>Below is the HTML code.</p>
<p>Note: Please make sure to update the references of the JavaScript and CSS files when you upload it onto SharePoint document library.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image012.jpg"><img class="alignnone size-full wp-image-109" title="image012" src="http://sudhirke.files.wordpress.com/2011/02/image012.jpg?w=593" alt=""   /></a></p>
<h3>Deployment</h3>
<p>- Upload all the JS and CSS file along with the HTML file onto SharePoint document library.</p>
<p>- Add a content editor web part and add link of the myjQuery.html file in the Content Link property.</p>
<p>- Below is the folder structure.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image006.jpg"><img class="alignnone size-full wp-image-103" title="image006" src="http://sudhirke.files.wordpress.com/2011/02/image006.jpg?w=593" alt=""   /></a></p>
<p>- JS folder contains required all the JavaScript files.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image007.jpg"><img class="alignnone size-full wp-image-104" title="image007" src="http://sudhirke.files.wordpress.com/2011/02/image007.jpg?w=593" alt=""   /></a></p>
<p>- CSS folder structure looks something similar to image below.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/02/image0081.jpg"><img class="alignnone size-full wp-image-105" title="image0081" src="http://sudhirke.files.wordpress.com/2011/02/image0081.jpg?w=593" alt=""   /></a></p>
<p>Hope this helps someone in need. Comments/Suggestions welcomed J</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=101&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/02/11/jquery-sharepoint-contact-card-web-part-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image001.jpg" medium="image">
			<media:title type="html">image001</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image0091.jpg" medium="image">
			<media:title type="html">image0091</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image0101.jpg" medium="image">
			<media:title type="html">image0101</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image011.jpg" medium="image">
			<media:title type="html">image011</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image012.jpg" medium="image">
			<media:title type="html">image012</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image006.jpg" medium="image">
			<media:title type="html">image006</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image007.jpg" medium="image">
			<media:title type="html">image007</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/02/image0081.jpg" medium="image">
			<media:title type="html">image0081</media:title>
		</media:content>
	</item>
		<item>
		<title>Will be participating in PostAWeek challange&#8230;</title>
		<link>http://sudhirke.wordpress.com/2011/01/19/will-be-participating-in-postaweek-challange/</link>
		<comments>http://sudhirke.wordpress.com/2011/01/19/will-be-participating-in-postaweek-challange/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 06:47:29 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postaweek2011]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=67</guid>
		<description><![CDATA[I am a new joinee to the wordpress site.  And I must admit that I am simply loving it.  I had been blogging (although not so frequent in other site).  But now I have moved everything onto wordpress.com. I recently landed &#8230; <a href="http://sudhirke.wordpress.com/2011/01/19/will-be-participating-in-postaweek-challange/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=67&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am a new joinee to the wordpress site.  And I must admit that I am simply loving it.  I had been blogging (although not so frequent in other site).  But now I have moved everything onto wordpress.com.</p>
<p>I recently landed up onto a page <a href="http://dailypost.wordpress.com/2010/12/30/how-to-sign-up-postaday-postaweek/">Daily Posts at WordPress</a> and I think it motivated me to join the campaign.  So far this is the most innovative way to involve the bloggers to blog more.</p>
<p>I wordpress could compup with some contest on blogging (some form of rewards&#8230;hmmmm <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>I decided to join this campaign and I assure you that you will here more frequently from my side <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks wordpress for this initiative&#8230;.</p>
<p>-Sudhir Kesharwani</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=67&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/01/19/will-be-participating-in-postaweek-challange/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>
	</item>
		<item>
		<title>Sorting table using jQuery</title>
		<link>http://sudhirke.wordpress.com/2011/01/18/sorting-table-using-jquery/</link>
		<comments>http://sudhirke.wordpress.com/2011/01/18/sorting-table-using-jquery/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 14:03:15 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Content Query Web Part]]></category>
		<category><![CDATA[postaweek2011]]></category>
		<category><![CDATA[Table Sorter Plugin]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=55</guid>
		<description><![CDATA[Recently I worked for a requirement with my collegue Ankur Chourasia on consolidating the information from the sub sites and displaying it on the main site using Content Query Web Part.  I consider that as the first part of this &#8230; <a href="http://sudhirke.wordpress.com/2011/01/18/sorting-table-using-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=55&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I worked for a requirement with my collegue <a href="http://ankursharepoint.wordpress.com/" target="_blank">Ankur Chourasia </a>on consolidating the information from the sub sites and displaying it on the main site using Content Query Web Part.  I consider that as the first part of this post.  Please make sure to go through &#8220;<a href="http://ankursharepoint.wordpress.com/2011/01/19/a-little-more-about-content-query-web-parts/" target="_blank">A Little More about Content Query Web Part</a>&#8220;. The consolidation and additional column displaying part is done by Ankur Chourasia and he did it fantastically. I will surely encourage him to add that onto his blog site.<br />
There was another interesting requirement where in the user wanted the table data to be sorted. Just like we do in any other SharePoint lists, again my love jQuery came onto picture and we could achieve the sorting table functionality.</p>
<p>I found it worth putting down on paper and sharing. Comments welcome J</p>
<h2>JQuery Library</h2>
<p>The basic requirement to jQuerify any solution is the jQuery library. All we need to do is add a script tag that points to jQuery JavaScript file. For our solution we have downloaded the script file from <a href="http://docs.jquery.com/Downloading_jQuery">jQuery Download</a> page. We have uploaded the solution onto a document library the alternative way to enable jQuery is refer the file directly from <a href="http://code.google.com/apis/libraries/devguide.html#jquery">Google Code CDN</a>. The second way is definitely bit slowly since it has to load jQuery file from remote location.</p>
<h2>Table Sorter Plug-in</h2>
<p>The beauty of jQuery is the extensibility. We get plug-in written for almost every business problem, I was lucky here too many thanks to the simplest table sorter plug in by <a href="http://tablesorter.com/docs/">Christian Bach</a>. I downloaded the <a href="http://tablesorter.com/jquery.tablesorter.js">JavaScript</a> file and uploaded it onto the shared document. I also downloaded the StyleSheet to format my table from <a href="http://tablesorter.com/themes/blue/blue.zip">http://tablesorter.com/themes/blue/blue.zip</a>.</p>
<p>Here is the final structure of my files.</p>
<p><strong>Shared Documents</strong></p>
<p>è CSS</p>
<p>o Style.css</p>
<p>o Other gif files</p>
<p>è JS</p>
<p>o jquery.min.js</p>
<p>o jquery.tablesorter.min.js</p>
<p>è tablesort.html (this contains the jquery code)</p>
<h2>JQuery Code</h2>
<p>The jQuery code is pretty easy for this. Add the reference to jQuery library and Table Sorter javascript file along with stylesheet (style.css). in the jQuery code call tablesorter() method for all the “table” tags. This is it. Following is the code snippet. I have kept this code in tablesort.html file.</p>
<h2><a href="http://sudhirke.files.wordpress.com/2011/01/jquery.jpg"><img class="alignnone size-medium wp-image-88" title="jQuery" src="http://sudhirke.files.wordpress.com/2011/01/jquery.jpg?w=300&#038;h=46" alt="" width="300" height="46" /></a></h2>
<h2>HTML Code</h2>
<p>The table sorter plug in looks out for all the &lt;table&gt; tag which contains the “class=tablesorter” attribute. Other requirement is that the table columns should be inside the &lt;thead&gt; element and table body should be inside the &lt;tbody&gt; element. For e.g.</p>
<h2><a href="http://sudhirke.files.wordpress.com/2011/01/html.jpg"><img class="alignnone size-full wp-image-89" title="html" src="http://sudhirke.files.wordpress.com/2011/01/html.jpg?w=593" alt=""   /></a></h2>
<h2>ItemStyle.xsl template modification</h2>
<p>Here is the modified template in the ItemStyle.xsl file to achieve the required html output. Notice the class attribute of &lt;table&gt; element the &lt;thead&gt; and &lt;tbody&gt; elements.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/01/image003.jpg"><img class="alignnone size-full wp-image-56" title="image003" src="http://sudhirke.files.wordpress.com/2011/01/image003.jpg?w=593" alt=""   /></a></p>
<h2>Enabling sorting on the CQWP tables</h2>
<p>- Upload the modified ItemStyle.xsl file onto Style Library.</p>
<p>- Make sure that required JavaScript files and html file are uploaded on the SharePoint document library.</p>
<p>- Navigate to the page where you have added the Content Query Web Part.</p>
<p>- Add a Content Editor Web Part. Edit the web part and set the Content Link property to URL of “TableSort.html” file in the Shared Documents library (e.g yoursitedocumentstableSort.html).</p>
<p><em>Tip: You can keep this content editor web part as hidden, the jquery code to enable sorting will still work.</em></p>
<p><a href="http://sudhirke.files.wordpress.com/2011/01/image004.jpg"><img class="alignnone size-full wp-image-57" title="image004" src="http://sudhirke.files.wordpress.com/2011/01/image004.jpg?w=593" alt=""   /></a></p>
<p>- This will make the column heading clickable. Clicking on the column heading will sort the rows of the table.</p>
<p><a href="http://sudhirke.files.wordpress.com/2011/01/image005.jpg"><img class="alignnone size-full wp-image-58" title="image005" src="http://sudhirke.files.wordpress.com/2011/01/image005.jpg?w=593" alt=""   /></a></p>
<h2>End Note</h2>
<p>I hope this helps some one in need. I sincerely like to thank Ankur Chourasia and <a href="http://tablesorter.com/docs/">Christian Bach</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=55&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/01/18/sorting-table-using-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/01/jquery.jpg?w=300" medium="image">
			<media:title type="html">jQuery</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/01/html.jpg" medium="image">
			<media:title type="html">html</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/01/image003.jpg" medium="image">
			<media:title type="html">image003</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/01/image004.jpg" medium="image">
			<media:title type="html">image004</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2011/01/image005.jpg" medium="image">
			<media:title type="html">image005</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding &#8220;Recent Blog Post&#8221; web part programatically</title>
		<link>http://sudhirke.wordpress.com/2011/01/15/adding-recent-blog-post-web-part-programatically/</link>
		<comments>http://sudhirke.wordpress.com/2011/01/15/adding-recent-blog-post-web-part-programatically/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 16:30:45 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[WSS 3.0]]></category>
		<category><![CDATA[My Site web parts]]></category>
		<category><![CDATA[postaweek2011]]></category>
		<category><![CDATA[Recent Blog Posts]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=47</guid>
		<description><![CDATA[This is a very basic post.  I really couldn&#8217;t find any post that could tell me how to add &#8220;Recent Blog Posts&#8221; web part using object modal. The &#8220;Recent Blog Posts&#8221; web part is added by default on the SharePoint &#8230; <a href="http://sudhirke.wordpress.com/2011/01/15/adding-recent-blog-post-web-part-programatically/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=47&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a very basic post.  I really couldn&#8217;t find any post that could tell me how to add &#8220;Recent Blog Posts&#8221; web part using object modal.</p>
<p>The &#8220;Recent Blog Posts&#8221; web part is added by default on the SharePoint 2010 My Sites.  I was just wondering if we can add that using the SharePoint Object Modal.</p>
<p>I found out that adding a recent blog posts web part is really simple:-</p>
<blockquote><p>// Get the web part collection<br />
SPLimitedWebPartManager wpManager = web.GetLimitedWebPartManager(&#8220;default.aspx&#8221;, PersonalizationScope.Shared);</p>
<p>Microsoft.SharePoint.Portal.WebControls.BlogView wpBlogView = new BlogView();<br />
/*This Is very important.  Make sure To Link To the xsl file*/<br />
wpBlogView.XslLink = &#8220;blog.xsl&#8221;;<br />
wpBlogView.Title = &#8220;Recent Blog Posts&#8221;;</p>
<p>wpManager.AddWebPart(wpBlogView, &#8220;WebPartZone&#8221;, 0);</p></blockquote>
<p>Hope this helps some one in need <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Regards,</p>
<p>Sudhir</p>
<div id="_mcePaste">﻿</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=47&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2011/01/15/adding-recent-blog-post-web-part-programatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Magic &#8211; Search List Web Part</title>
		<link>http://sudhirke.wordpress.com/2010/12/15/jquery-magic-search-list-web-part/</link>
		<comments>http://sudhirke.wordpress.com/2010/12/15/jquery-magic-search-list-web-part/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 14:08:04 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[SharePoint Web Services]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[postaweek2011]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[SharePoint Web Service]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/?p=5</guid>
		<description><![CDATA[Contents jQuery Magic – Search List Web Part 1 Overview. Search Web Part. See it in action….. HTML Script 3 Inline Style Sheet 4 jQuery(fication) : Enabling the Magical Library. 4 jQuery: $(document).ready() handler 5 jQuery: The Search() function. 6 &#8230; <a href="http://sudhirke.wordpress.com/2010/12/15/jquery-magic-search-list-web-part/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=5&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Contents</p>
<ol>
<li><a href="#_Toc278391115">jQuery Magic – Search List Web Part 1</a></li>
<li><a href="#_Toc278391116">Overview.</a></li>
<li><a href="#_Toc278391117">Search Web Part.</a></li>
<li><a href="#_Toc278391118">See it in action…..</a></li>
<li><a href="#_Toc278391119">HTML Script 3</a></li>
<li><a href="#_Toc278391120">Inline Style Sheet 4</a></li>
<li><a href="#_Toc278391121">jQuery(fication) : Enabling the Magical Library. 4</a></li>
<li><a href="#_Toc278391122">jQuery: $(document).ready() handler 5</a></li>
<li><a href="#_Toc278391123">jQuery: The Search() function. 6</a></li>
<li><a href="#_Toc278391124">jQuery: the processResult() function. 7</a></li>
<li><a href="#_Toc278391125">References. 7</a></li>
<li><a href="#_Toc278391126">Summary. 8</a></li>
</ol>
<h2><a>Overview</a></h2>
<p>After being quite for sometimes now, I am back with another jQuery magic. The search list web part, this is really handy when you have some data in SharePoint that hardly gets updated, rather than opening the list we could directly add a search web part on the home page and get the data.</p>
<h2><a>Search Web Part.</a></h2>
<p>The search web part that we are going to see will look something similar to figure1. I have made the script to search in the Calendar list based on the event location.</p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image001.jpg"><img class="alignnone size-full wp-image-6" title="image001" src="http://sudhirke.files.wordpress.com/2010/12/image001.jpg?w=593" alt=""   /></a></p>
<p>Figure 1</p>
<p>This web part can be configured to search on any SharePoint list. Following section of this article will cover the scripts in detail.</p>
<h3><a>See it in action…</a></h3>
<p>I thought of showing it in action to you before we dig deeper onto the code. Follow the instruction carefully.</p>
<p>1. Download the required files from <a href="https://docs.google.com/leaf?id=0B1XvO-SvpjhGMjU3OWY4NmYtZTU1OS00ODhmLThmYjgtYjFjZjM5NTYxYWIz&amp;hl=en&amp;authkey=CLSJ-bcH">jQuery Magic – Search List Web Part</a></p>
<p>· <strong>jquery.highlight-latest.min.js</strong>: This is the jQuery highlight plunging. This is used to highlight the searched terms. Sincere thanks to <a href="http://johannburkard.de/">Johann Burkard</a> for his <a href="http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html">Highlight Plugin</a></p>
<p>· <strong>searchList.js</strong>: This contains the logic to interact with the SharePoint services and render the required controls.</p>
<p>2. Update the references.</p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><a href="http://sudhirke.files.wordpress.com/2010/12/image010.png"><img class="alignnone size-full wp-image-7" title="image010" src="http://sudhirke.files.wordpress.com/2010/12/image010.png?w=593" alt=""   /></a></td>
</tr>
</tbody>
</table>
<p>3. Upload both the files onto a SharePoint document library.</p>
<p>4. Add a content editor web part à and update the Content Link property to point to <strong>searchList.js</strong></p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image011.jpg"><img class="alignnone size-full wp-image-8" title="image011" src="http://sudhirke.files.wordpress.com/2010/12/image011.jpg?w=593" alt=""   /></a></p>
<p>Figure 2</p>
<p>5. Click ok and you are done. You will see the search list web part in your page.</p>
<h2><a>HTML Script</a></h2>
<p>Following is the HTML script that is required to render the UI of the search web part. This HTML defines following element in the web part</p>
<p>- <strong>quickSearchTextBox</strong>: Text box to enter the query.</p>
<p>- <strong>cmdSearch</strong>: Command button to initiate search.</p>
<p>- <strong>resultCount</strong>: Div element to show the number of records found from query.</p>
<p>- <strong>quickSearchResults</strong>: Div element to show the result.</p>
<p><em>I have used the SharePoint style sheet classes to format the UI look similar to SharePoint.</em></p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image012.png"><img class="alignnone size-full wp-image-9" title="image012" src="http://sudhirke.files.wordpress.com/2010/12/image012.png?w=593" alt=""   /></a></p>
<h2><a>Inline Style Sheet</a></h2>
<p>The inline style sheet classes have been used to format the output and display it in the form of block. Following are the classes in this style sheet.</p>
<p>- .<strong>highlight</strong> : This class is used to define formatting for highlighting the search terms in the results.</p>
<p>- .<strong>ul</strong>: this class is used to remove the bullets in the UL element.</p>
<p>- .<strong>ul</strong> <strong>li</strong> : This class is used to display the search results in the form of block.<a href="http://sudhirke.files.wordpress.com/2010/12/image013.png"><img class="alignnone size-full wp-image-10" title="image013" src="http://sudhirke.files.wordpress.com/2010/12/image013.png?w=593" alt=""   /></a></p>
<h2><a>jQuery(fication) : Enabling the Magical Library</a></h2>
<p>To load the jQuery library, I have used the direct link (ajax.googleapis.com). I am not uploading the jQuery library on my SharePoint (I did that in all my previous posts).</p>
<p>In case you want to load jQuery from local SharePoint site you will have to upload <a href="http://www.jquery.com/">jQuery library</a> onto your SharePoint document library and update the SRC parameter in the following code. (<em>Note: You will have to update the {SPURL} for jquery.highlight-latest.min.js file</em>)</p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image014.png"><img class="alignnone size-full wp-image-11" title="image014" src="http://sudhirke.files.wordpress.com/2010/12/image014.png?w=593" alt=""   /></a></p>
<h3><a>jQuery: $(document).ready() handler</a></h3>
<p>$(document).ready() handler is similar to void main() in C J. This script written inside this hander is executed when the entire DOM elements have been loaded.</p>
<p>jQuery script should be written inside ready() handler. Please refer to <a href="http://docs.jquery.com/Main_Page">jQuery Documentation</a> to learn more about writing jQuery script.</p>
<p>I have used ready() handler to associate various event handlers to the controls in my web part. This contains various ways to initiate search operation and other handler to clear search result when “X” is clicked.</p>
<p>Note that to clear the result I have used $(selector).live() handler, this will make sure to attach event handler with “X” button only when it is present in the UI.</p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image015.png"><img class="alignnone size-full wp-image-12" title="image015" src="http://sudhirke.files.wordpress.com/2010/12/image015.png?w=593" alt=""   /></a></p>
<h3><a>jQuery: The Search() function</a></h3>
<p>The search function takes care of talking to the lists.asmx SharePoint web service. This function prepares the soap request with the query and processes the result.</p>
<p>The soap packet contains the CAML query to search the list. It defines following parameter to execute the query:</p>
<p>- listName : Name of the source list.</p>
<p>- Query : Query to execute against the list</p>
<p>- viewFields: Fields that should be returned in the result.</p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image016.png"><img class="alignnone size-full wp-image-13" title="image016" src="http://sudhirke.files.wordpress.com/2010/12/image016.png?w=593" alt=""   /></a></p>
<p>jQuery.ajax() function is used to send the request to the lists web service. The complete attribute specifies the function name that should be executed once this request has been processed. The process result method will receive the resulting xml from the web service call.</p>
<h3><a>jQuery: the processResult() function</a></h3>
<p>The processResult() method is used to generate the resultant HTML script from the web service call result xml file. The role of this method is to parse the xml and get the required HTML.</p>
<p>Please excuse me for the bad formatting (I am really bad in the designing).</p>
<p><a href="http://sudhirke.files.wordpress.com/2010/12/image017.png"><img class="alignnone size-full wp-image-14" title="image017" src="http://sudhirke.files.wordpress.com/2010/12/image017.png?w=593" alt=""   /></a></p>
<p><em>Notice the code that we have used to highlight the searched terms in the result set.</em></p>
<h2><a>References</a></h2>
<p>- <a href="http://docs.jquery.com/Main_Page">http://docs.jquery.com/Main_Page</a></p>
<p>- <a href="http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html">http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html</a></p>
<p>- <a href="http://spservices.codeplex.com/">http://spservices.codeplex.com/</a></p>
<p>- <a href="http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx">http://weblogs.asp.net/jan/archive/2009/04/09/calling-the-sharepoint-web-services-with-jquery.aspx</a></p>
<h2><a>Summary</a></h2>
<p>I have done very basic formatting to the search results. Be as creative as you can in the processResults() method, use the jQuery UI library to format the output.</p>
<p>We can build some really fantastic application with no server side coding and deployment overheads using jQuery.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=5&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2010/12/15/jquery-magic-search-list-web-part/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image001.jpg" medium="image">
			<media:title type="html">image001</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image010.png" medium="image">
			<media:title type="html">image010</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image011.jpg" medium="image">
			<media:title type="html">image011</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image012.png" medium="image">
			<media:title type="html">image012</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image013.png" medium="image">
			<media:title type="html">image013</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image014.png" medium="image">
			<media:title type="html">image014</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image015.png" medium="image">
			<media:title type="html">image015</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image016.png" medium="image">
			<media:title type="html">image016</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/12/image017.png" medium="image">
			<media:title type="html">image017</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery : Enhancing List View web part rendering</title>
		<link>http://sudhirke.wordpress.com/2010/08/06/jquery-enhancing-list-view-web-part-rendering/</link>
		<comments>http://sudhirke.wordpress.com/2010/08/06/jquery-enhancing-list-view-web-part-rendering/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 11:58:00 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[SharePoint Web Services]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/2010/08/06/jquery-enhancing-list-view-web-part-rendering</guid>
		<description><![CDATA[ContentsjQuery : Enhancing List View web part rendering&#160;&#160;&#160;&#160;1 Overview&#160;&#160;&#160;&#160;1 Requirements&#160;&#160;&#160;&#160;1 Solution&#160;&#160;&#160;&#160;1 jQuery – the lightweight magic&#160;&#160;&#160;&#160;2 Overview The more I work on&#160;jQuery + SharePoint the more I get attracted to it.&#160; There is limitless possibility when we use&#160;jQuery in SharePoint.&#160; &#8230; <a href="http://sudhirke.wordpress.com/2010/08/06/jquery-enhancing-list-view-web-part-rendering/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=31&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span></span><br /><span style="color:#365f91;font-size:14pt;"><strong>Contents</strong></span><br /><a href="http://www.blogger.com/post-edit.g?blogID=7656963684930501591&amp;postID=3711044039821398777#_Toc268877831">jQuery : Enhancing List View web part rendering&nbsp;&nbsp;&nbsp;&nbsp;1</a>
<div style="margin-left:11pt;"><a href="http://www.blogger.com/post-edit.g?blogID=7656963684930501591&amp;postID=3711044039821398777#_Toc268877832">Overview&nbsp;&nbsp;&nbsp;&nbsp;1</a></div>
<div style="margin-left:11pt;"><a href="http://www.blogger.com/post-edit.g?blogID=7656963684930501591&amp;postID=3711044039821398777#_Toc268877833">Requirements&nbsp;&nbsp;&nbsp;&nbsp;1</a></div>
<div style="margin-left:11pt;"><a href="http://www.blogger.com/post-edit.g?blogID=7656963684930501591&amp;postID=3711044039821398777#_Toc268877834">Solution&nbsp;&nbsp;&nbsp;&nbsp;1</a></div>
<div style="margin-left:11pt;"><a href="http://www.blogger.com/post-edit.g?blogID=7656963684930501591&amp;postID=3711044039821398777#_Toc268877835">jQuery – the lightweight magic&nbsp;&nbsp;&nbsp;&nbsp;2</a></div>
<h2>Overview</h2>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">The more I work on&nbsp;jQuery + SharePoint the more I get attracted to it.&nbsp; There is limitless possibility when we use&nbsp;jQuery in SharePoint.&nbsp; My latest research includes enhancing the way&nbsp;ListView web part gets rendered. </span></div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">Once you get hold of the&nbsp;jQuery selector you feel like everything is possible and is very much in your hands. You just have to find a unique way of getting the required DOM element and then it obeys all your orders like a Gin (I am sure I am not exaggerating). </span></div>
<p><span style="font-family:Arial;font-size:10pt;">I hope this helps someone in need.</span></p>
<p>
<h2>Requirements</h2>
<p><span style="font-family:Arial;font-size:10pt;">The requirement was to display following table in a web part.</span></p>
<p>
<div>
<table border="0" style="border-collapse:collapse;">
<col style="width:160px;">
<col style="width:160px;">
<col style="width:160px;">
<col style="width:160px;">
<tbody valign="top">
<tr style="background:#e5e5e5;">
<td style="border-bottom:black 1pt solid;border-left:black 1pt solid;border-right:black 1pt solid;border-top:black 1pt solid;padding-left:7px;padding-right:7px;">
<div style="text-align:center;"><span style="font-family:Arial;font-size:9pt;">Topic</span></div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:black 1pt solid;padding-left:7px;padding-right:7px;">
<div style="text-align:center;"><span style="font-family:Arial;font-size:9pt;">Presenter</span></div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:black 1pt solid;padding-left:7px;padding-right:7px;">
<div style="text-align:center;"><span style="font-family:Arial;font-size:9pt;">Link to Presentation</span></div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:black 1pt solid;padding-left:7px;padding-right:7px;">
<div style="text-align:center;"><span style="font-family:Arial;font-size:9pt;">Link to Video</span></div>
</td>
</tr>
<tr>
<td style="border-bottom:black 1pt solid;border-left:black 1pt solid;border-right:black 1pt solid;border-top:medium none;padding-left:7px;padding-right:7px;"><span style="font-family:Arial;font-size:9pt;">Some topic</span></td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;padding-left:7px;padding-right:7px;"><span style="font-family:Arial;font-size:9pt;">Some presenter</span></td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;padding-left:7px;padding-right:7px;"><span style="font-family:Arial;font-size:9pt;">[ICON to download ppt]</span></td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;padding-left:7px;padding-right:7px;"><span style="font-family:Arial;font-size:9pt;">[Icon to download video]</span></td>
</tr>
</tbody>
</table>
</div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">I first thought of reading the data using our dear friend SharePoint web services and then rendering it on my own way.&nbsp; But then I thought I should be able to do it in some&nbsp;OOB way.&nbsp; But the issue was that I had to show two icons that are linked to content</span></div>
<div style="margin-left:36pt;"><span style="font-family:Arial;font-size:10pt;">-</span><span style="font-family:Times New Roman;font-size:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family:Arial;font-size:10pt;">Icon to download presentation.</span></div>
<div style="margin-left:36pt;"><span style="font-family:Arial;font-size:10pt;">-</span><span style="font-family:Times New Roman;font-size:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family:Arial;font-size:10pt;">Icon to download the video.</span></div>
<h2>Solution</h2>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">I uploaded all the presentations onto the document library.&nbsp; The default document library did not have the columns to display the additional metadata about the presentation.&nbsp; So I created the columns that described the presentation.</span></div>
<div style="margin-left:36pt;"><span style="font-family:Arial;font-size:10pt;">-</span><span style="font-family:Times New Roman;font-size:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family:Arial;font-size:10pt;">Topic (Single line of text)</span></div>
<div style="margin-left:36pt;"><span style="font-family:Arial;font-size:10pt;">-</span><span style="font-family:Times New Roman;font-size:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family:Arial;font-size:10pt;">Presenter (Single line of text)</span></div>
<div style="margin-left:36pt;"><span style="font-family:Arial;font-size:10pt;">-</span><span style="font-family:Times New Roman;font-size:7pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family:Arial;font-size:10pt;">Video (Hyperlink that will contain the URL to video)</span></div>
<div style="text-align:center;"></div>
<div class="separator" style="clear:both;text-align:center;"></div>
<div class="separator" style="clear:both;text-align:center;"><a href="http://sudhirke.files.wordpress.com/2010/08/picture1.jpg" style="margin-left:1em;margin-right:1em;"><img border="0" height="216" src="http://sudhirke.files.wordpress.com/2010/08/picture1.jpg?w=400&#038;h=216" width="400" /></a></div>
<div style="text-align:center;"><span style="color:#4f81bd;"><strong><span style="font-size:9pt;">Figure 1</span></strong></span></div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">I uploaded the videos in the same folder and updated the metadata of presentation to contain link to the video file.</span></div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">The benefit that I get out of this is the &#8220;Type&#8221; column renders the icon and it is linked to the original document.&nbsp; And I had added the other metadata using columns, this is 70% complete, I still have the task to display the icon that is linked to video.&nbsp; </span></div>
<p><span style="font-family:Arial;font-size:10pt;">When I add the list view web part I could see following view.</span></p>
<p>
<div style="text-align:center;"></div>
<div class="separator" style="clear:both;text-align:center;"><a href="http://sudhirke.files.wordpress.com/2010/08/picture21.jpg" style="margin-left:1em;margin-right:1em;"><img border="0" height="144" src="http://sudhirke.files.wordpress.com/2010/08/picture21.jpg?w=640&#038;h=144" width="640" /></a></div>
<div style="text-align:center;"><span style="color:#4f81bd;"><strong><span style="font-size:9pt;">Figure 2</span><span style="font-family:Arial;font-size:10pt;"><br /></span></strong></span></div>
<p><span style="font-family:Arial;font-size:10pt;"><span style="background-color:yellow;">Note: Video column was getting rendered as the plain hyperlink.</span></span></p>
<p>
<h2>jQuery – the lightweight magic</h2>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">Since I am a big fan of&nbsp;jQuery and I knew there must be a way to select everything on the page.&nbsp; I did some analysis on how this is rendered.&nbsp; I found that its all Table and TD tags.&nbsp; So the list view table is rendered as </span></div>
<p><span style="color:red;font-family:Arial;font-size:10pt;">&lt;TABLE &#8212;- <strong>summary=&#8221;&lt;&lt;Web Part Title&gt;&gt;&#8221;</strong>&gt;</span></p>
<p>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">Something worth noting is that the table contains a property called summary and the value contains the web part title.&nbsp; Now the next job is to find how the link is getting rendered further down the line I found something interesting.</span></div>
<p><span style="color:red;font-family:Arial;font-size:10pt;">&lt;TR&gt;&lt;TD Class=&#8221;ms-vb2&#8243;&gt;&lt;A HREF=&#8221;URL of Video&#8221;&gt;Text to Display&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;</span></p>
<p><span style="font-family:Arial;font-size:10pt;">So it was a TD that contained class &#8220;ms-vb2&#8243; and contained a child node as &lt;a&gt;.</span></p>
<p>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">Once I identified the way it renders the link it was just a matter of replacing the text of &lt;a&gt; with &lt;img&gt; of my choice.&nbsp; </span></div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">By this time all the&nbsp;jQuery folks have an idea of how to do that.&nbsp; Still I thought of copying the magical part of the script.</span></div>
<div style="text-align:justify;"><span style="font-size:9pt;"><em><span style="background-color:yellow;font-family:Arial;">Note: My apologies for copying this as image, but for some reason I was not able to publish this document when it contained jQuery code. (Google and Blogger started boggling me </span><span style="background-color:yellow;font-family:Wingdings;">J</span><span style="font-family:Arial;"><span style="background-color:yellow;">)</span></span></em></span></div>
<div class="separator" style="clear:both;text-align:center;"><a href="http://sudhirke.files.wordpress.com/2010/08/picture31.jpg" style="margin-left:1em;margin-right:1em;"><img border="0" height="72" src="http://sudhirke.files.wordpress.com/2010/08/picture31.jpg?w=640&#038;h=72" width="640" /></a></div>
<p>
<div style="text-align:center;"><span style="color:#4f81bd;"><strong><span style="font-size:9pt;">Figure 3</span><span style="font-family:Arial;font-size:10pt;"><br /></span></strong></span></div>
<div style="text-align:justify;"><span style="font-family:Arial;font-size:10pt;">Just replace web part title with the summary of your list view table.&nbsp; And here is the final output.</span></div>
<div style="text-align:center;"></div>
<div class="separator" style="clear:both;text-align:center;"><a href="http://sudhirke.files.wordpress.com/2010/08/picture41.jpg" style="margin-left:1em;margin-right:1em;"><img border="0" height="21" src="http://sudhirke.files.wordpress.com/2010/08/picture41.jpg?w=400&#038;h=21" width="400" /></a></div>
<div style="text-align:center;"><span style="color:#4f81bd;"><strong><span style="font-size:9pt;">Figure 4</span><span style="font-family:Arial;font-size:10pt;"><br /></span></strong></span></div>
<div style="text-align:justify;"><span style="font-size:10pt;"><span style="font-family:Arial;">Now you see that I have the desired icon to download video and it looks really good.&nbsp; And all that I needed was 4 lines of&nbsp;jQuery and understand how SharePoint renders the contents. </span><span style="font-family:Wingdings;"></span><span style="font-family:Arial;"><br /></span></span></div>
<p><span style="font-family:Arial;"><span style="font-size:9pt;"><span style="color:grey;">Regards</span><span style="color:blue;">,&nbsp;</span><span style="color:#f79646;">Sudhir&nbsp;Kesharwani</span></span><span style="font-size:10pt;"><span style="color:#ff6600;">&nbsp;</span><span style="color:blue;">&nbsp;</span></span><span style="color:grey;font-size:7pt;">MCTS &#8211; MOSS&nbsp;2007 |&nbsp;MCTS -&nbsp;WSS 3.0 | MCPD-EA |&nbsp;MCSD.NET&nbsp; </span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=31&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2010/08/06/jquery-enhancing-list-view-web-part-rendering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>

		<media:content url="http://sudhirke.files.wordpress.com/2010/08/picture1.jpg?w=300" medium="image" />

		<media:content url="http://sudhirke.files.wordpress.com/2010/08/picture21.jpg?w=300" medium="image" />

		<media:content url="http://sudhirke.files.wordpress.com/2010/08/picture31.jpg?w=300" medium="image" />

		<media:content url="http://sudhirke.files.wordpress.com/2010/08/picture41.jpg?w=300" medium="image" />
	</item>
		<item>
		<title>Using LinQ to query xml</title>
		<link>http://sudhirke.wordpress.com/2010/06/09/using-linq-to-query-xml/</link>
		<comments>http://sudhirke.wordpress.com/2010/06/09/using-linq-to-query-xml/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 14:06:00 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/2010/06/09/using-linq-to-query-xml</guid>
		<description><![CDATA[-&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Create a xml file with following structure. &#60;?xml version=&#8220;1.0&#8220; encoding=&#8220;utf-8&#8220; ?&#62; &#60;Errors&#62; &#160; &#60;Error voucherId=&#8220;1&#8220; message=&#8220;Issues while saving data&#8220;/&#62; &#160; &#60;Error voucherId=&#8220;1&#8220; message=&#8220;Transaction Blocked&#8220;/&#62; &#160; &#60;Error voucherId=&#8220;1&#8220; message=&#8220;Account is Closed&#8220;/&#62; &#160; &#60;Error voucherId=&#8220;3&#8220; message=&#8220;This voucher has minumum balance.&#8220;/&#62; &#160; &#8230; <a href="http://sudhirke.wordpress.com/2010/06/09/using-linq-to-query-xml/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=30&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="Section1">
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>Create a xml file with following structure.</div>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&lt;?</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">xml</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">version</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">1.0</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">encoding</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">utf-8</span>&#8220;<span style="color:blue;"> ?&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Errors</span><span style="color:blue;font-family:&quot;font-size:10pt;">&gt;</span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&nbsp; &lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Error</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">voucherId</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">message</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Issues while saving data</span>&#8220;<span style="color:blue;">/&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&nbsp; &lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Error</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">voucherId</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">message</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Transaction Blocked</span>&#8220;<span style="color:blue;">/&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&nbsp; &lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Error</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">voucherId</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">1</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">message</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Account is Closed</span>&#8220;<span style="color:blue;">/&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&nbsp; &lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Error</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">voucherId</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">3</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">message</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">This voucher has minumum balance.</span>&#8220;<span style="color:blue;">/&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&nbsp; &lt;</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Error</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><span style="color:red;font-family:&quot;font-size:10pt;">voucherId</span><span style="color:blue;font-family:&quot;font-size:10pt;">=</span><span style="font-family:&quot;font-size:10pt;">&#8220;<span style="color:blue;">3</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">message</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Some errors occured while saving the voucher.</span>&#8220;<span style="color:blue;">/&gt;</span></span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">&lt;/</span><span style="color:#a31515;font-family:&quot;font-size:10pt;">Errors</span><span style="color:blue;font-family:&quot;font-size:10pt;">&gt;</span></div>
<p>
<div class="MsoNormal" style="margin-left:.25in;"><span style="color:blue;font-family:&quot;font-size:10pt;"></span></div>
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>Make sure your code file has following references</div>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">using</span><span style="font-family:&quot;font-size:10pt;"> System.Linq;</span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"><span style="color:blue;font-family:&quot;font-size:10pt;">using</span><span style="font-family:&quot;font-size:10pt;"> System.Xml.Linq;</span></div>
<p>
<div class="MsoNormal" style="margin-left:.5in;"></div>
<p>
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>Open Visual Studio 2008 and create a new console application.&nbsp; Write following code on the program.cs file.</div>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:grey;">///</span><span style="color:green;"> </span><span style="color:grey;">&lt;summary&gt;</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:grey;">///</span><span style="color:green;"> Class to represent an error message.&nbsp; You can have similar class to represent your data</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:grey;">///</span><span style="color:green;"> </span><span style="color:grey;">&lt;/summary&gt;</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Error</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">string</span> VoucherId { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">string</span> ErrorMessage { <span style="color:blue;">get</span>; <span style="color:blue;">set</span>; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;"></span></div>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">static</span> <span style="color:blue;">void</span> Main(<span style="color:blue;">string</span>[] args)</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:green;">//Load XML document on to XDocument object</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">XDocument</span> xdoc = <span style="color:#2b91af;">XDocument</span>.Load(<span style="color:#a31515;">&#8220;../../ErrorMessages.xml&#8221;</span>);</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;"></span></div>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:green;">//Query the XML document and read all the &#8220;Error&#8221; element.&nbsp; Prepare a list of Error class from the returned data</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">Error</span>&gt; errorCollection = (<span style="color:blue;">from</span> errors <span style="color:blue;">in</span> xdoc.Descendants(<span style="color:#a31515;">&#8220;Error&#8221;</span>)</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">where</span> errors.Attribute(<span style="color:#a31515;">&#8220;voucherId&#8221;</span>).Value==<span style="color:#a31515;">&#8220;1&#8243;</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">select</span> <span style="color:blue;">new</span> <span style="color:#2b91af;">Error</span> </span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VoucherId = errors.Attribute(<span style="color:#a31515;">&#8220;voucherId&#8221;</span>).Value,</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ErrorMessage = errors.Attribute(<span style="color:#a31515;">&#8220;message&#8221;</span>).Value</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ).ToList&lt;<span style="color:#2b91af;">Error</span>&gt;();</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;"></span></div>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:green;">//Loop through the returned collection and output the result.</span></span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:blue;">foreach</span> (<span style="color:#2b91af;">Error</span> e <span style="color:blue;">in</span> errorCollection)</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Voucher Id: &#8220;</span> + e.VoucherId);</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">&#8220;Error Message: &#8220;</span> + e.ErrorMessage);</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#2b91af;">Console</span>.ReadKey();</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div>
<p>
<div class="MsoNormal"><span style="font-family:&quot;font-size:10pt;">&nbsp;&nbsp;&nbsp; }</span></div>
<p>
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Execute this console application and it will print </span></span>the selected nodes from xml</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal" style="margin-left:.25in;"></div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Regards,</div>
<div class="MsoNormal">Sudhir Kesharwani</div>
<div class="MsoNormal">Mob: +91 98225 11209</div>
<div class="MsoNormal"></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=30&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2010/06/09/using-linq-to-query-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating URL field using Lists.asmx</title>
		<link>http://sudhirke.wordpress.com/2010/06/09/updating-url-field-using-lists-asmx/</link>
		<comments>http://sudhirke.wordpress.com/2010/06/09/updating-url-field-using-lists-asmx/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 13:49:00 +0000</pubDate>
		<dc:creator>Sudhir Kesharwani</dc:creator>
				<category><![CDATA[Lists.asmx]]></category>
		<category><![CDATA[SharePoint Web Services]]></category>
		<category><![CDATA[UpdateListItems()]]></category>
		<category><![CDATA[Updating URL Field]]></category>

		<guid isPermaLink="false">http://sudhirke.wordpress.com/2010/06/09/updating-url-field-using-lists-asmx</guid>
		<description><![CDATA[Updating URL field using SharePoint Lists Web Service (Lists.asmx) One thing that I always complain about SharePoint 2007 web service is lack of documentation and samples.&#160; This is the most neglected areas of SharePoint 2007.&#160; I hope this have been &#8230; <a href="http://sudhirke.wordpress.com/2010/06/09/updating-url-field-using-lists-asmx/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=27&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="Section1">
<div class="MsoNormal"><b>Updating URL field using SharePoint Lists Web Service (Lists.asmx)</b></div>
<p>
<div class="MsoNormal"><b></b></div>
<div class="MsoNormal">One thing that I always complain about SharePoint 2007 web service is lack of documentation and samples.&nbsp; This is the most neglected areas of SharePoint 2007.&nbsp; I hope this have been improved in SharePoint 2010 especially since Microsoft has added a lot of new web services.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">I had been working on a jQuery based SharePoint solution to display a modal popup to all the visitors. Apart from displaying the jQuery pop up dialogue on page load, I also had to record the history about visitor.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">I had to update the list items using Lists.asmx UpdateListItems() method.&nbsp; </div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">My custom list had following fields:-</div>
<div class="MsoNormal"></div>
<p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-bottom:medium none;border-collapse:collapse;border-left:medium none;border-right:medium none;border-top:medium none;">
<tbody>
<tr style="height:14.7pt;">
<td style="background:#f79646;border-bottom:black 1pt solid;border-left:black 1pt solid;border-right:black 1pt solid;border-top:black 1pt solid;height:14.7pt;width:76.1pt;padding:0 5.4pt;" valign="top" width="101">
<div class="MsoNormal">Field Name</div>
</td>
<td style="background:#f79646;border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:black 1pt solid;height:14.7pt;width:45pt;padding:0 5.4pt;" valign="top" width="60">
<div class="MsoNormal">Type</div>
</td>
<td style="background:#f79646;border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:black 1pt solid;height:14.7pt;width:189pt;padding:0 5.4pt;" valign="top" width="252">
<div class="MsoNormal">Description</div>
</td>
</tr>
<tr style="height:14.7pt;">
<td style="border-bottom:black 1pt solid;border-left:black 1pt solid;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:76.1pt;padding:0 5.4pt;" valign="top" width="101">
<div class="MsoNormal">Title</div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:45pt;padding:0 5.4pt;" valign="top" width="60">
<div class="MsoNormal">Text</div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:189pt;padding:0 5.4pt;" valign="top" width="252">
<div class="MsoNormal">This field is used to record the login name of logged in user</div>
</td>
</tr>
<tr style="height:14.7pt;">
<td style="border-bottom:black 1pt solid;border-left:black 1pt solid;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:76.1pt;padding:0 5.4pt;" valign="top" width="101">
<div class="MsoNormal">URL</div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:45pt;padding:0 5.4pt;" valign="top" width="60">
<div class="MsoNormal">URL</div>
</td>
<td style="border-bottom:black 1pt solid;border-left:medium none;border-right:black 1pt solid;border-top:medium none;height:14.7pt;width:189pt;padding:0 5.4pt;" valign="top" width="252">
<div class="MsoNormal">This field is used to store the link of a text file hosted on server.</div>
</td>
</tr>
</tbody>
</table>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">After struggling for some time I found that updating the URL field requires some additional attention, since the SharePoint URL field value consists of two parts &lt;URL&gt;, &lt;Description&gt;. Even when working with Object Modal we have to use <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldurlvalue.aspx">SPUrlFieldValue</a>.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Please make sure to follow these guidelines while updating the URL field through web services.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>Please notice that URL needs to include “<b><a href="http:///">http:</a>//” </b>e.g. <a href="http://www.google.com/">http://www.google.com/</a>, generally we write <a href="http://www.google.com/">http://www.google.com/</a> and think that SharePoint should be intelligent enough to append http, but this is not the case.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoListParagraph" style="text-indent:-.25in;"><span>-<span style="font-family:&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>The other thing is that we need to make sure to include a space between the comma (,) and description.&nbsp; So our URL field value needs to have <i>&lt;URL including http://&gt;,&lt;SPACE&gt;&lt;Description&gt;, e.g. <a href="http://www.google.com/">http://www.google.com/</a>, Google.</i></div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Please pay extra attention while updating/Reading the URL field (through Web Service or thorough object modal).</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Here is how the element should look in your soap envelope.</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal"><b>&lt;Field Name=”URL”&gt;http:\\www.google.com, Google&lt;/Field&gt;</b></div>
<p>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Here is my soap envelop for calling the UpdateListItems() method. I have omitted the other parts of calling the web service for clarity. (You get lots of examples through Google)</div>
<div style="border-bottom:windowtext 1pt solid;border-left:medium none;border-right:medium none;border-top:medium none;padding:0 0 1pt;">
<div class="MsoNormal" style="border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding:0;"></div>
</div>
<div class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The SOAP Envelope</div>
<div class="MsoNormal">var soapEnv =</div>
<div class="MsoNormal">&#8220;&lt;?xml version=\&#8221;1.0\&#8221; encoding=\&#8221;utf-8\&#8221;?&gt; \</div>
<div class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:Envelope xmlns:xsi=\&#8221;http://www.w3.org/2001/XMLSchema-instance\&#8221; \</div>
<div class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:xsd=\&#8221;http://www.w3.org/2001/XMLSchema\&#8221; \</div>
<div class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:soap=\&#8221;http://schemas.xmlsoap.org/soap/envelope/\&#8221;&gt; \</div>
<div class="MsoNormal" style="margin-left:.5in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:Body&gt; \</div>
<div class="MsoNormal" style="margin-left:1in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;UpdateListItems xmlns=\&#8221;http://schemas.microsoft.com/sharepoint/soap/\&#8221;&gt; \</div>
<div class="MsoNormal" style="margin-left:1.5in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;listName&gt;Audit&lt;/listName&gt; \</div>
<div class="MsoNormal" style="margin-left:1.5in;text-indent:.5in;">&nbsp;&lt;updates&gt; \</div>
<div class="MsoNormal" style="margin-left:1.5in;text-indent:.5in;"><span style="color:#00b050;">&lt;Batch OnError=\&#8221;Continue\&#8221;&gt; \</span></div>
<p>
<div class="MsoNormal"><span style="color:#00b050;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Method ID=\&#8221;1\&#8221; Cmd=\&#8221;New\&#8221;&gt; \</span></div>
<p>
<div class="MsoNormal"><span style="color:#00b050;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Field Name=\&#8221;Title\&#8221;&gt;Some Text&lt;/Field&gt; \</span></div>
<p>
<div class="MsoNormal" style="margin-left:3in;"><b><span style="color:#f79646;">&lt;Field Name=\&#8221;URL\&#8221;&gt;http://www.google.com, Google&lt;/Field&gt; \</span></b></div>
<p>
<div class="MsoNormal"><span style="color:#00b050;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/Method&gt; \</span></div>
<p>
<div class="MsoNormal" style="margin-left:1.5in;text-indent:.5in;"><span style="color:#00b050;">&lt;/Batch&gt;</span></div>
<p>
<div class="MsoNormal" style="margin-left:1.5in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/updates&gt; \</div>
<div class="MsoNormal" style="margin-left:1in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/UpdateListItems&gt; \</div>
<div class="MsoNormal" style="margin-left:.5in;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/soap:Body&gt; \</div>
<div class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/soap:Envelope&gt;&#8221;;</div>
<div class="MsoNormal"></div>
<p>
<div style="border-bottom:windowtext 1pt solid;border-left:medium none;border-right:medium none;border-top:medium none;padding:0 0 1pt;">
<div class="MsoNormal" style="border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding:0;"></div>
</div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal">Hope this helps someone in need <span style="font-family:Wingdings;">J</span></div>
<div class="MsoNormal"></div>
<p>
<div class="MsoNormal"><span style="color:grey;font-family:&quot;font-size:9pt;">Regards</span><span style="color:blue;font-family:&quot;font-size:9pt;">, </span><br /><span style="color:#f79646;font-family:&quot;font-size:9pt;">Sudhir Kesharwani</span><span style="color:#ff6600;font-family:&quot;font-size:10pt;">&nbsp;</span><span style="color:blue;font-family:&quot;font-size:10pt;"> </span><br /><span style="color:grey;font-family:&quot;font-size:7.5pt;">MCTS &#8211; MOSS&nbsp;2007 | MCTS &#8211; WSS 3.0 | MCPD-EA | MCSD.NET&nbsp; </span></div>
<div class="MsoNormal"></div>
</div>
<div id="##disclaimer##">
<div style="font-family:Arial, Sans-Serif;font-size:x-small;"></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sudhirke.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sudhirke.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sudhirke.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sudhirke.wordpress.com&amp;blog=18432650&amp;post=27&amp;subd=sudhirke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sudhirke.wordpress.com/2010/06/09/updating-url-field-using-lists-asmx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fc6cd7023ad109175dd7514ef8513693?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sudhirke</media:title>
		</media:content>
	</item>
	</channel>
</rss>
