<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-762936358880048492</id><updated>2012-02-16T07:27:57.955-08:00</updated><title type='text'>sriblog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-2359983529171247501</id><published>2011-12-27T20:32:00.000-08:00</published><updated>2011-12-27T20:54:15.272-08:00</updated><title type='text'>Way to wait for jQuery's JSON method retruning from server</title><content type='html'>There are some scenarios where we may need to set the value for the text box or some html control based up on the value returned from the JSON.&lt;br /&gt;&lt;br /&gt;I had scenario where two method.&lt;br /&gt;&lt;br /&gt;1) JSON call&lt;br /&gt;2) Normal Jquery/javascript function call&lt;br /&gt;&lt;br /&gt;My thought was that till JSON call got executed my second method wont execute, since JSON is ASYNC call it wont till it get response from JSON, it will start executing our Jquery method.&lt;br /&gt;&lt;br /&gt;The problem starts here, i was setting few variable(global) in 1st method and using them in the 2nd method.&lt;br /&gt;&lt;br /&gt;Since it takes time to execute the 1st method, so the values will be loaded properly.&lt;br /&gt;&lt;br /&gt;So we need to use  $(document).ready(function () {&lt;br /&gt;$.ajaxSetup({'async': false});&lt;br /&gt;//Method1()&lt;br /&gt;//Method2()&lt;br /&gt;    });&lt;br /&gt;&lt;br /&gt;This will work like synchronous and this fixed my issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-2359983529171247501?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/2359983529171247501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/12/way-to-wait-for-jquerys-json-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2359983529171247501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2359983529171247501'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/12/way-to-wait-for-jquerys-json-method.html' title='Way to wait for jQuery&apos;s JSON method retruning from server'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1532262694315204347</id><published>2011-10-11T02:35:00.000-07:00</published><updated>2011-10-20T02:48:33.438-07:00</updated><title type='text'>Anti XSS</title><content type='html'>Today I came across one of the more weird issue in the production environment.&lt;br /&gt;&lt;br /&gt;The site is developed in sharepoint 2010, and we have a search box in the page.&lt;br /&gt;&lt;br /&gt;When user try to enter some of the javascript code ex: &lt;script&gt;alert('hi')&lt;/script&gt; in the search text box, our site was broking(in the sence styles) all the times.&lt;br /&gt;&lt;br /&gt;By default sharepoint will take care of Anti cross side scripting for the all the out of the box the control(specially with search).&lt;br /&gt;&lt;br /&gt;But in our case it was breaking. After doing an investigation I came to know some where we are writing the text query in the page(As a title we are using this).&lt;br /&gt;&lt;br /&gt;There we are not doing AntiXss for the that. After fixing this our page rendered as expected.&lt;br /&gt;&lt;br /&gt;To get more information about AntiXss please follow this post.&lt;br /&gt;&lt;br /&gt;http://ha.ckers.org/xss.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1532262694315204347?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1532262694315204347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/10/anti-xss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1532262694315204347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1532262694315204347'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/10/anti-xss.html' title='Anti XSS'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-899681385328208649</id><published>2011-07-23T05:02:00.000-07:00</published><updated>2011-08-01T08:00:23.688-07:00</updated><title type='text'>App page vs Site pages</title><content type='html'>&lt;strong&gt;Application Pages:&lt;/strong&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;1.These are the normal .aspx pages deployed within SharePoint. Most common of them are the admin pages found in _layouts folder. &lt;br /&gt;&lt;br /&gt;2.These are deployed either at the farm level or at application level. If they are deployed within _layouts folder or global SharePoint Virtual Directory, then they can be used by any SharePoint application (available at farm level), otherwise they can be deployed at application level only by creating a virtual directory.&lt;br /&gt;&lt;br /&gt;3.These are typical ASP.Net aspx pages and can utilize all of the functionalities available within ASP.Net including code-behind, code-beside, inline coding etc.&lt;br /&gt;&lt;br /&gt;4.These are compiled by .Net runtime like normal pages.&lt;br /&gt;&lt;br /&gt;5.They can only use master pages available on file-system not within SharePoint Content Databases and for the same reason, you will notice that _layouts pages can only use Application master page deployed within _layouts folder and cannot use any of your custom master page deployed within SharePoint masterpage library. &lt;br /&gt;&lt;br /&gt;6.If you deploy your custom ASPX pages within _layouts folder or within SharePoint application using a virtual directory, you will not be able to use SharePoint master pages and have to deploy your master page within the virtual directory or _layouts folder.&lt;br /&gt;&lt;br /&gt;7.Application Pages cannot use contents as this concept is associated with SharePoint Page Layouts not with ASP.Net.&lt;br /&gt;&lt;br /&gt;8.Since application pages are compiled once, they are much faster&lt;br /&gt;&lt;br /&gt;9.Normally application pages are not web part pages, hence can only contain server controls or user controls and cannot be personalized by users.&lt;br /&gt;&lt;br /&gt;10.Easiest way to deploy your existing ASP.Net web site within SharePoint is to deploy its pages as Application Pages within SharePoint. In this way you can convert any ASP.Net web solution as SharePoint application with minimal efforts.&lt;br /&gt;&lt;br /&gt;11.SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.&lt;br /&gt;&lt;br /&gt;12.Application pages can be globalized using Resource files only. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Site Pages&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1.Site Pages is a concept where complete or partial page is stored within content database and then actual page is parsed at runtime and delivered to end-users.&lt;br /&gt;&lt;br /&gt;2.Pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages&lt;br /&gt;&lt;br /&gt;3.You must be thinking why we should use such pages? There are many reasons for this. One of the biggest catch of the SharePoint is the page layouts, where you can modify page once for a specific content type and then you can create multiple pages using the same page layout with different contents. In this case, contents are stored within database for better manageability of data with all the advantages of a data driven system like searching, indexing, compression, etc and page layouts are stored on file system and final page is created by merging both of them and then the outcome is pared by SharePoint not compiled.&lt;br /&gt;&lt;br /&gt;4.Site Pages can contain web parts as well as contents placeholders, and all of them are stored per page-instance level within database and then retrieved at run time, parsed and rendered.&lt;br /&gt;&lt;br /&gt;5.Another advantage is they are at user-level not at web-application or farm level and can be customized per site level.&lt;br /&gt;&lt;br /&gt;6.Since their definition is retrieved from database, they can utilize master pages stored within SharePoint masterpages library and merged with them at run time for rendering.&lt;br /&gt;&lt;br /&gt;7.They are slower as compared to Application pages as they are parsed everytime they are accessed.&lt;br /&gt;&lt;br /&gt;8.SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.&lt;br /&gt;&lt;br /&gt;9.Since they are rendered not compiled hence it is not easy to add any inline code, code behind or code beside. Best way of adding code to these pages is through web-parts, server controls in master pages, user controls stored in "Control Templates" folder or through smart parts. If you want to add any inline code to master page, first you need to add following configuration within web.config:&lt;br /&gt;&lt;br /&gt;PageParserPaths&lt;br /&gt;       PageParserPath VirtualPath="/_catalogs/masterpage/*"  CompilationMode="Always"                                 AllowServerSideScript="true" IncludeSubFolders="true" /&lt;br /&gt;PageParserPaths&lt;br /&gt;&lt;br /&gt;10.To add code behind to SharePoint master pages or page layouts, refer to this MSDN article&lt;br /&gt;&lt;br /&gt;11.Since Site pages are content pages, hence all SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages.&lt;br /&gt;&lt;br /&gt;12.Variations can only be applied against Site pages for creating multilingual sites.&lt;br /&gt;&lt;br /&gt;13."SPVirtualPathProvider" is the virtual path provider responsible for handling all site pages requests. It handles both ghosted and unghosted pages requests as shown below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-RelJ4o6uvC0/Tiq4-6hxWmI/AAAAAAAAABw/qfiUqfI4-HM/s1600/aeb80e3a3521af1aef5d7d8273d320c8.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 189px;" src="http://1.bp.blogspot.com/-RelJ4o6uvC0/Tiq4-6hxWmI/AAAAAAAAABw/qfiUqfI4-HM/s320/aeb80e3a3521af1aef5d7d8273d320c8.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5632517674982529634" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-e0nbZ6LAtMw/Tiq5IuhTTRI/AAAAAAAAAB4/zwPQZ8yESYQ/s1600/6e26db80f26a050fa71ef22270134ba7.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 300px; height: 184px;" src="http://2.bp.blogspot.com/-e0nbZ6LAtMw/Tiq5IuhTTRI/AAAAAAAAAB4/zwPQZ8yESYQ/s320/6e26db80f26a050fa71ef22270134ba7.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5632517843558026514" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-899681385328208649?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/899681385328208649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/07/app-page-vs-site-pages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/899681385328208649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/899681385328208649'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/07/app-page-vs-site-pages.html' title='App page vs Site pages'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-RelJ4o6uvC0/Tiq4-6hxWmI/AAAAAAAAABw/qfiUqfI4-HM/s72-c/aeb80e3a3521af1aef5d7d8273d320c8.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-3723205958923797211</id><published>2011-05-06T05:59:00.000-07:00</published><updated>2011-05-06T06:03:26.097-07:00</updated><title type='text'>Creating Mysite host in moss 2007</title><content type='html'>1) Create a new web application (e.g. http://mossdev1:25000/)&lt;br /&gt;   2)  Inspect Managed Paths for the new web application. You should already have:&lt;br /&gt;        (root) - Explicit inclusion&lt;br /&gt;        sites - Wildcard inclusion&lt;br /&gt;   3) Delete managed paths:&lt;br /&gt;        sites - Wildcard inclusion&lt;br /&gt;   4) Create managed paths:&lt;br /&gt;        personal - Wildcard inclusion&lt;br /&gt;        mysite - Explicit inclusion&lt;br /&gt;   5) End state for managed paths should be:&lt;br /&gt;        (root) - Explicit inclusion (thanks to imsaurabh for catching this!)&lt;br /&gt;        personal - Wildcard inclusion&lt;br /&gt;        mysite - Explicit inclusion&lt;br /&gt;   6) Create a site collection at /mysite/ managed path. This will use a My Site Host template:&lt;br /&gt;        Choose correct web application (e.g. http://mossdev1:25000/)&lt;br /&gt;        Title: My Site Host (doesn’t matter, really)&lt;br /&gt;        URL: http://mossdev1:25000/mysite (no fill-in because path is explicit in managed paths)&lt;br /&gt;        Template: Enterprise (tab) -&gt; My Site Host&lt;br /&gt;        Specify primary and secondary administrators.&lt;br /&gt;        Click OK.&lt;br /&gt;   7) Create a blank site collection at the / managed path to enable self-service site creation:&lt;br /&gt;        Choose correct web application (e.g. http://mossdev1:25000/)&lt;br /&gt;        Title: Blank site (doesn’t matter, really)&lt;br /&gt;        URL: http://mossdev1:25000/ (no fill-in because path is explicit in managed paths)&lt;br /&gt;        Template: Collaboration (tab) -&gt; Blank Site&lt;br /&gt;        Specify primary and secondary administrators.&lt;br /&gt;        Click OK.&lt;br /&gt;   8) Enable Self-Service Management. Choose from Application Management -&gt; Application Security.&lt;br /&gt;&lt;br /&gt;Now that you’ve created the host, here’s how to make sure it works properly in the SSP’s My Site Settings:&lt;br /&gt;&lt;br /&gt;   1) Navigate to My Site Settings (go to your SSP’s admin pages, it’s the 3rd link in the 1st section).&lt;br /&gt;       a) For form’s sake, inspect the Preferred Search Center entry. This URL should end in /SearchCenter/Pages/.&lt;br /&gt;        Set Personal Site Services to http://mossdev1:25000/mysite/. Note that this points to the URL for the explicit inclusion path and My Site Host Template site collection you created above.&lt;br /&gt;       b) Set Personal site Location into just personal. Note that this points to the URL (after SharePoint puts context to it) for the Wildcard inclusion managed path you created above.&lt;br /&gt;       c) Choose the 2nd Site Naming Format: User name (resolve conflicts by using domain_username).&lt;br /&gt;       d) Enable Allow user to choose the language of their personal site.&lt;br /&gt;       e) Disable My Site to support global deployments.&lt;br /&gt;       f) Default Reader Site Group: NT AUTHORITY\authenticated users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-3723205958923797211?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/3723205958923797211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/05/creating-mysite-host-in-moss-2007.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3723205958923797211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3723205958923797211'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2011/05/creating-mysite-host-in-moss-2007.html' title='Creating Mysite host in moss 2007'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-110977519325285566</id><published>2010-12-21T00:52:00.000-08:00</published><updated>2010-12-21T00:53:02.783-08:00</updated><title type='text'>SharePoint Server 2010 capacity management: Software boundaries and limits</title><content type='html'>Please refer the following site to get more details.&lt;br /&gt;&lt;br /&gt;http://technet.microsoft.com/en-us/library/cc262787.aspx#UPA&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-110977519325285566?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/110977519325285566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/12/sharepoint-server-2010-capacity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/110977519325285566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/110977519325285566'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/12/sharepoint-server-2010-capacity.html' title='SharePoint Server 2010 capacity management: Software boundaries and limits'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-2258936544505565975</id><published>2010-11-22T01:13:00.000-08:00</published><updated>2010-11-22T01:14:50.725-08:00</updated><title type='text'>Workflow Links</title><content type='html'>This are the good links available for workflows,&lt;br /&gt;&lt;br /&gt;http://blogs.msdn.com/b/sharepoint/archive/tags/workflow/&lt;br /&gt;&lt;br /&gt;For creating State machine workflow&lt;br /&gt;http://blogs.msdn.com/b/sharepoint/archive/tags/workflow/&lt;br /&gt;&lt;br /&gt;Integrating infopath with workflows&lt;br /&gt;http://nisha081.spaces.live.com/Blog/cns!6F578843FD095913!1265.entry&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-2258936544505565975?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/2258936544505565975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/workflow-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2258936544505565975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2258936544505565975'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/workflow-links.html' title='Workflow Links'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-7454572609774285902</id><published>2010-11-03T03:34:00.000-07:00</published><updated>2010-11-03T03:44:59.424-07:00</updated><title type='text'>How to access web.config in timer job code</title><content type='html'>This is common scenario where some times we may need to access the web.config file in sharepoint custom timer job. But timer job is running under OWSTIMER.EXE, but sharepoint is running under the context of w3wp process, So its difficult to access the web.config file in the timer job code. To overcome this we need to create the instance of the webapp and Configuration and then we can access the web config file.&lt;br /&gt;&lt;br /&gt;Below is the sample snippet code where we can access the web.config file.&lt;br /&gt;&lt;br /&gt;//Get the instance of the current webapplication&lt;br /&gt;SPWebApplication webApp = this.Parent as SPWebApplication;   &lt;br /&gt;&lt;br /&gt;//Create the webconfig instance by using web application name&lt;br /&gt;Configuration webconfig = WebConfigurationManager.OpenWebConfiguration("/", webApp.Name);   &lt;br /&gt;//Get the configured value from web config using the key value in my case its "MYKEY"&lt;br /&gt;&lt;br /&gt;string appValue = webconfig.AppSettings.Settings["MYKEY"].Value.ToString(); &lt;br /&gt;&lt;br /&gt;The above code needs to written in Execute method of the timer job definition file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-7454572609774285902?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/7454572609774285902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/how-to-access-webconfig-in-timer-job.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7454572609774285902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7454572609774285902'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/how-to-access-webconfig-in-timer-job.html' title='How to access web.config in timer job code'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-875530331789935784</id><published>2010-11-01T23:34:00.000-07:00</published><updated>2010-11-02T01:18:16.747-07:00</updated><title type='text'>Updating Master Page and Page layout</title><content type='html'>Updating MAster page and page layout through feature receiver&lt;br /&gt;&lt;br /&gt;http://narunkumar.wordpress.com/2010/06/25/updating-a-sharepoint-master-page-page-layout-via-a-solution-wsp/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-875530331789935784?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/875530331789935784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/updating-master-page-and-page-layout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/875530331789935784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/875530331789935784'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/11/updating-master-page-and-page-layout.html' title='Updating Master Page and Page layout'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-3376394851257820582</id><published>2010-10-21T02:45:00.000-07:00</published><updated>2010-10-21T03:17:59.889-07:00</updated><title type='text'>Infopath form services in sharepoint 2010</title><content type='html'>Some times Infopath form services are not available in sharepoint(2010) under general application settings in central admin.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_ByXWjxaF_7k/TMAQ0AInqHI/AAAAAAAAAAc/yB7icGjXtSM/s1600/untitled.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 174px;" src="http://2.bp.blogspot.com/_ByXWjxaF_7k/TMAQ0AInqHI/AAAAAAAAAAc/yB7icGjXtSM/s320/untitled.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5530438827986364530" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to get this links?&lt;br /&gt;&lt;br /&gt;Follow this steps to get the infopath form services in sharepoint cetral admin.&lt;br /&gt;&lt;br /&gt;1) Install the feature "IPFSAdminWeb" either by using stsadm or PS(Powershell)&lt;br /&gt;2) After this feature is installed the infopath form services will be availabel, if this feature is not available then we need to activate this feature explicitly in sharepoint central admin. This can be done through stsadm or PS.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_ByXWjxaF_7k/TMASVcBJQuI/AAAAAAAAAAs/5KM3_J6dfG8/s1600/untitled1.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 213px;" src="http://1.bp.blogspot.com/_ByXWjxaF_7k/TMASVcBJQuI/AAAAAAAAAAs/5KM3_J6dfG8/s320/untitled1.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5530440501918515938" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) If everything works fine then well and good but some times when we click on infopath form services then we will get the page not found error.&lt;br /&gt;&lt;br /&gt;Then there should sharepoint version problem. If sharepoint Client Access License is installed  then this will cause the problem.&lt;br /&gt;&lt;br /&gt;4) How to change the version&lt;br /&gt;Open SharePoint Central Administration and went to the (i.e. upgradeandmigration.aspx on the Central Admininstration site).&lt;br /&gt;In the "Upgrade and Patch Management" section click on the "Convert farm license type" link to bring up the Conversion.aspx page. &lt;br /&gt;Enter in the new product key and convert to the "SharePoint Server with Enterprise Client Access License" edition.&lt;br /&gt;Now go back to the General Application Settings page in SharePoint Central Administration and you should now see the "InfoPath Forms Services" section with its links.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-3376394851257820582?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/3376394851257820582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/10/infopath-form-services-in-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3376394851257820582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3376394851257820582'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/10/infopath-form-services-in-sharepoint.html' title='Infopath form services in sharepoint 2010'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ByXWjxaF_7k/TMAQ0AInqHI/AAAAAAAAAAc/yB7icGjXtSM/s72-c/untitled.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-2104682704709866874</id><published>2010-08-03T02:18:00.001-07:00</published><updated>2010-08-03T02:27:18.409-07:00</updated><title type='text'>Code deployment in sharepoint 2010</title><content type='html'>There are basically now three different ways to deploy custom assemblies:&lt;br /&gt;&lt;br /&gt;•Full trust solutions - The assemblies are registered in the GAC and runs under full trust &lt;br /&gt;•Partial trust solutions - The assemblies are deployed to the bin folder of a specific Web Application &lt;br /&gt;•Sandboxed solutions - The assemblies (solutions) are deployed to the Site Collection gallery &lt;br /&gt;&lt;br /&gt;Sandboxed Solutions&lt;br /&gt;The Sandboxed Solutions runs inside the a special service, called Microsoft SharePoint Foundation Sandboxed Code Service, which is a completely and separate application domain than the SharePoint application pools. The Sandboxed solutions are monitored and if they consume to much resources or fails to many times SharePoint automatically shuts the solution down. The code running in a Sandboxed assembly does not have access to the full SharePoint API, basically it's just the classes from Site Collection level and below. The sandbox is also protected with a very minimal CAS policy which for example prohibits the user code solutions from calling web services, making database calls or accessing the file system.&lt;br /&gt;&lt;br /&gt;Sandboxed solutions are deployed into the Solution gallery of a Site Collection and only access that Site Collection. They can be deployed without having any downtime of the farm or web application. Anyone within the Site Collection Administrators group can upload solutions to the gallery and activate them. Farm administrators controls how much resources each Sandbox can use and can also block specific solutions from running at all.&lt;br /&gt;&lt;br /&gt;Pros Cons &lt;br /&gt;Can easily be deployed by Site Collection Administrators Very limited CAS policy &lt;br /&gt;Resource usage is monitored * Current uncertainty about the monitoring stability &lt;br /&gt;Secure Hard to deploy in a farm &lt;br /&gt;Great support in Visual Studio 2010   &lt;br /&gt;Only crashes the Sandbox if it blows   &lt;br /&gt;&lt;br /&gt;There is a timer job which is running every 15 minutes to check the resource usage. Based on this timer job it will block the solution from running.&lt;br /&gt;&lt;br /&gt;Farm Solutions&lt;br /&gt;The Farm solutions or full trust solutions adds the assembly to the Global Assembly Cache, GAC, which means that they can run without any CAS policies, i.e. under full trust. The assemblies can be accessed from any application in the farm. Full-trust solutions are the most common way to install solutions since it is easy and requires no knowledge of for instance CAS policies. The code running in a full trust solution has the same access as the application pool account to the local server and can do almost what it want with the server. Deploying Farm solutions should only be done with code that we really trust. &lt;br /&gt;&lt;br /&gt;Only farm administrators can upload new farm solutions to the configuration database and most often an application pool recycle is needed, especially when updating solutions.&lt;br /&gt;&lt;br /&gt;Pros Cons &lt;br /&gt;Easy to implement Only Farm Administrators can add new solutions &lt;br /&gt;Great support in Visual Studio 2010 Downtime when updating &lt;br /&gt;Runs in full trust Have to much privileges &lt;br /&gt;  Can crash the whole server &lt;br /&gt;&lt;br /&gt;Web Application Solutions&lt;br /&gt;Solutions deployed to the web application bin directory was the way to go in SharePoint 2007 when we wanted/needed to secure our application using CAS. This partial trust option is still valid in SharePoint 2010. Web application deployed solutions by default only have a very minimal CAS policy applied. Using custom CAS policies it is easy to give more privileges to assembly. Installing these solutions also requires a Farm Administrator but they are only applied to specific Web Applications. Updating the assembly does not require an application pool recycle.&lt;br /&gt;&lt;br /&gt;Visual Studio 2010 have support for Web Application deployment but not for custom CAS policies. We have to install the solution using PowerShell or create our own Visual Studio SharePoint Deployment Steps.&lt;br /&gt;&lt;br /&gt;Pros Cons &lt;br /&gt;Security policies can be configured and kept minimal Only Farm Administrators can add new solutions&lt;br /&gt;Minimal downtime when upgrading No support OOB for custom CAS policies in Visual Studio 2010 &lt;br /&gt;Only crashes the web application&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-2104682704709866874?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/2104682704709866874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/08/code-deployment-in-sharepoint-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2104682704709866874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2104682704709866874'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/08/code-deployment-in-sharepoint-2010.html' title='Code deployment in sharepoint 2010'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-4911841637016580316</id><published>2010-06-16T23:26:00.005-07:00</published><updated>2010-06-16T23:26:32.378-07:00</updated><title type='text'>State machine vs sequential workflow</title><content type='html'>Sequential Workflow:&lt;br /&gt;A sequential workflow is a predictable workflow. The execution path might branch, or loop, or wait for an outside event to occur, but in the end, the sequential workflow will use the activities, conditions, and rules we've provided to march inevitably forward. The workflow is in control of the process.&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself.&lt;br /&gt;&lt;br /&gt;State Machine Workflow:&lt;br /&gt;A state-machine workflow is an event driven workflow. That is, the state machine workflow relies on external events to drive the workflow to completion. We define the legal states of the workflow, and the legal transitions between those states. The workflow is always in one of the states, and has to wait for an event to arrive before transitioning to a new state. Generally, the important decisions happen outside of the workflow. The state machine defines a structure to follow, but control belongs to the outside world.&lt;br /&gt;We use a state machine workflow when the decision-making happens outside the workflow.&lt;br /&gt;&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself. We use a state machine workflow when the decision-making happens outside the workflow. In this chapter, we will take a closer look at how state machines operate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-4911841637016580316?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/4911841637016580316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow_1090.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4911841637016580316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4911841637016580316'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow_1090.html' title='State machine vs sequential workflow'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1289418142688914936</id><published>2010-06-16T23:26:00.003-07:00</published><updated>2010-06-16T23:26:32.215-07:00</updated><title type='text'>State machine vs sequential workflow</title><content type='html'>Sequential Workflow:&lt;br /&gt;A sequential workflow is a predictable workflow. The execution path might branch, or loop, or wait for an outside event to occur, but in the end, the sequential workflow will use the activities, conditions, and rules we've provided to march inevitably forward. The workflow is in control of the process.&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself.&lt;br /&gt;&lt;br /&gt;State Machine Workflow:&lt;br /&gt;A state-machine workflow is an event driven workflow. That is, the state machine workflow relies on external events to drive the workflow to completion. We define the legal states of the workflow, and the legal transitions between those states. The workflow is always in one of the states, and has to wait for an event to arrive before transitioning to a new state. Generally, the important decisions happen outside of the workflow. The state machine defines a structure to follow, but control belongs to the outside world.&lt;br /&gt;We use a state machine workflow when the decision-making happens outside the workflow.&lt;br /&gt;&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself. We use a state machine workflow when the decision-making happens outside the workflow. In this chapter, we will take a closer look at how state machines operate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1289418142688914936?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1289418142688914936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1289418142688914936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1289418142688914936'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow_16.html' title='State machine vs sequential workflow'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1924121532293871514</id><published>2010-06-16T23:26:00.001-07:00</published><updated>2010-06-16T23:26:31.403-07:00</updated><title type='text'>State machine vs sequential workflow</title><content type='html'>Sequential Workflow:&lt;br /&gt;A sequential workflow is a predictable workflow. The execution path might branch, or loop, or wait for an outside event to occur, but in the end, the sequential workflow will use the activities, conditions, and rules we've provided to march inevitably forward. The workflow is in control of the process.&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself.&lt;br /&gt;&lt;br /&gt;State Machine Workflow:&lt;br /&gt;A state-machine workflow is an event driven workflow. That is, the state machine workflow relies on external events to drive the workflow to completion. We define the legal states of the workflow, and the legal transitions between those states. The workflow is always in one of the states, and has to wait for an event to arrive before transitioning to a new state. Generally, the important decisions happen outside of the workflow. The state machine defines a structure to follow, but control belongs to the outside world.&lt;br /&gt;We use a state machine workflow when the decision-making happens outside the workflow.&lt;br /&gt;&lt;br /&gt;We use a sequential workflow when we can encode most of the decision-making inside the workflow itself. We use a state machine workflow when the decision-making happens outside the workflow. In this chapter, we will take a closer look at how state machines operate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1924121532293871514?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1924121532293871514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1924121532293871514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1924121532293871514'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/06/state-machine-vs-sequential-workflow.html' title='State machine vs sequential workflow'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-345230441886782314</id><published>2010-04-26T02:01:00.000-07:00</published><updated>2010-04-26T02:03:21.581-07:00</updated><title type='text'>Timer Jobs</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_ByXWjxaF_7k/S9VWtLAs6HI/AAAAAAAAAAM/qa_dYP3yRC8/s1600/Timerjob.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 43px;" src="http://4.bp.blogspot.com/_ByXWjxaF_7k/S9VWtLAs6HI/AAAAAAAAAAM/qa_dYP3yRC8/s320/Timerjob.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5464369056933800050" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-345230441886782314?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/345230441886782314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/04/timer-jobs.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/345230441886782314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/345230441886782314'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/04/timer-jobs.html' title='Timer Jobs'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ByXWjxaF_7k/S9VWtLAs6HI/AAAAAAAAAAM/qa_dYP3yRC8/s72-c/Timerjob.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-4248733760053691970</id><published>2010-02-15T00:03:00.000-08:00</published><updated>2010-02-15T00:05:56.404-08:00</updated><title type='text'>Creating custom field with multiple line of text (object model)</title><content type='html'>If we want to create field multiple line of text through object model then we can use SPFieldType.Note(this will create multiple line of text column).&lt;br /&gt;If we create with SPFieldType.Text then it will be single line of text.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-4248733760053691970?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/4248733760053691970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/02/creating-custom-field-with-multiple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4248733760053691970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4248733760053691970'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/02/creating-custom-field-with-multiple.html' title='Creating custom field with multiple line of text (object model)'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-9028289244951784723</id><published>2010-01-19T19:43:00.001-08:00</published><updated>2010-01-19T19:45:44.489-08:00</updated><title type='text'>Cannot insert the value NULL into column Name</title><content type='html'>This problem will arise when activating event handler/not sure about other feature.&lt;br /&gt;The reason behind this is the commented code in the element.xml. After removing the commented code the feature will be activate sucessfully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-9028289244951784723?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/9028289244951784723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/01/cannot-insert-value-null-into-column.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/9028289244951784723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/9028289244951784723'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/01/cannot-insert-value-null-into-column.html' title='Cannot insert the value NULL into column Name'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-469368316793193486</id><published>2010-01-12T01:41:00.000-08:00</published><updated>2010-01-12T01:48:02.693-08:00</updated><title type='text'>Using Objects in Event Receivers</title><content type='html'>Event receivers that instantiate SPSite, SPWeb, SPList, or SPListItem objects instead of using the instances passed via the event properties can cause the following problems: &lt;br /&gt;&lt;br /&gt;They cause additional roundtrips to the database. (One write operation can result in up to five additional roundtrips in each event receiver.) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Calling the Update method on these instances can cause subsequent Update calls in other registered event receivers to fail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-469368316793193486?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/469368316793193486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/01/using-objects-in-event-receivers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/469368316793193486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/469368316793193486'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2010/01/using-objects-in-event-receivers.html' title='Using Objects in Event Receivers'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-752603181804467302</id><published>2009-12-27T21:13:00.000-08:00</published><updated>2009-12-27T21:22:47.659-08:00</updated><title type='text'>Sharepoint Articles links</title><content type='html'>How to optimize a sharepoint server 2007 with Web content management&lt;br /&gt;1) http://msdn.microsoft.com/en-us/library/bb727371.aspx&lt;br /&gt;2) http://msdn.microsoft.com/en-us/library/bb727372.aspx&lt;br /&gt;&lt;br /&gt;10 steps to building XHTML compliant and performing MOSS publishing sites &lt;br /&gt;&lt;br /&gt;http://blogs.code-counsel.net/Wouter/Lists/Posts/Post.aspx?ID=103&lt;br /&gt;&lt;br /&gt;Best Coding practice while working with object model&lt;br /&gt;http://msdn.microsoft.com/en-us/library/bb687949.aspx&lt;br /&gt;&lt;br /&gt;Fire fox css issue&lt;br /&gt;http://www.webmasterworld.com/forum83/7738.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-752603181804467302?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/752603181804467302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/sharepoint-articles-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/752603181804467302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/752603181804467302'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/sharepoint-articles-links.html' title='Sharepoint Articles links'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1997823938731206338</id><published>2009-12-18T01:16:00.000-08:00</published><updated>2009-12-18T01:23:56.387-08:00</updated><title type='text'>Feature Stappling</title><content type='html'>Suppose when the site definition is already in use (and sites have been created) modifying a site definition once it has been deployed, since the site definition files on the filesystem are used for pages which are ghosted (not modified). &lt;br /&gt;At this time we can go with feature stappling.&lt;br /&gt;Some times it is also knows as site template association.&lt;br /&gt;So finally feature-stapling Feature provides the mappings between the Feature and site definition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1997823938731206338?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1997823938731206338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/feature-stappling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1997823938731206338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1997823938731206338'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/feature-stappling.html' title='Feature Stappling'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-5735564364496951332</id><published>2009-12-17T23:38:00.000-08:00</published><updated>2009-12-17T23:45:00.330-08:00</updated><title type='text'>How to check the List Template Id in sharepoint site</title><content type='html'>Its difficult to find the list template Id of the page library in publishig site.&lt;br /&gt;So in order to check list template Id of Page library or Image library follow the steps.&lt;br /&gt;1) Open http://site/pages/forms/allitems.aspx&lt;br /&gt;Check for view source of the page.Search for the keyword ctx.listtemplate, there you will find the list template id for the pages library.&lt;br /&gt;Same thing do it for Image library also.&lt;br /&gt;Some of the important template id are as follows.&lt;br /&gt;Value&lt;br /&gt; Description &lt;br /&gt;100 Generic list &lt;br /&gt;101 Document library &lt;br /&gt;102 Survey &lt;br /&gt;103 Links list &lt;br /&gt;104 Announcements list &lt;br /&gt;105 Contacts list &lt;br /&gt;106 Events list &lt;br /&gt;107 Tasks list &lt;br /&gt;108 Discussion board &lt;br /&gt;109 Picture library &lt;br /&gt;110 Data sources &lt;br /&gt;111 Site template gallery &lt;br /&gt;112 User Information list &lt;br /&gt;113 Web Part gallery &lt;br /&gt;114 List template gallery &lt;br /&gt;115 XML Form library &lt;br /&gt;116 Master pages gallery &lt;br /&gt;117 No-Code Workflows &lt;br /&gt;118 Custom Workflow Process &lt;br /&gt;119 Wiki Page library &lt;br /&gt;120 Custom grid for a list &lt;br /&gt;130 Data Connection library &lt;br /&gt;140 Workflow History &lt;br /&gt;150 Gantt Tasks list &lt;br /&gt;200 Meeting Series list &lt;br /&gt;201 Meeting Agenda list &lt;br /&gt;202 Meeting Attendees list &lt;br /&gt;204 Meeting Decisions list &lt;br /&gt;207 Meeting Objectives list &lt;br /&gt;210 Meeting text box &lt;br /&gt;211 Meeting Things To Bring list &lt;br /&gt;212 Meeting Workspace Pages list &lt;br /&gt;300 Portal Sites list &lt;br /&gt;301 Blog Posts list &lt;br /&gt;302 Blog Comments list &lt;br /&gt;303 Blog Categories list &lt;br /&gt;1100 Issue tracking &lt;br /&gt;1200 Administrator tasks list &lt;br /&gt;2002 Personal document library &lt;br /&gt;2003 Private document library&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-5735564364496951332?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/5735564364496951332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/how-to-check-list-template-id-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/5735564364496951332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/5735564364496951332'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/how-to-check-list-template-id-in.html' title='How to check the List Template Id in sharepoint site'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-4649962284840460990</id><published>2009-12-17T23:01:00.000-08:00</published><updated>2009-12-17T23:37:09.583-08:00</updated><title type='text'>Deploying event receivers</title><content type='html'>There are 3 ways we can deploy the event receivers.&lt;br /&gt;1) Deploying Programatically&lt;br /&gt;2) Via Feature&lt;br /&gt;3) With Content type&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Programatically&lt;/strong&gt;&lt;br /&gt;This can be done only when an event receiver need to be associated with a single instance of a list rather than with all list of with template ID.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;With Feature&lt;/strong&gt;&lt;br /&gt;Programmatic deploying will install the receiver againest a specific instance of a list and much reuse benefit is not possible in this.&lt;br /&gt;To overcome this we can use this method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Before creating any event handlers developers should think following points.  &lt;br /&gt;&lt;br /&gt;1. Security:&lt;br /&gt;&lt;br /&gt;The assembly you deploy to the Global Assembly Cache(GAC) is running with full trust. Watch out for the following:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;·         Denial of Service attack: If a user uploads 10000 items to a list, what is the effect it will have to the systems your assembly uses. &lt;br /&gt;&lt;br /&gt;·         SQL Injection attack: If a user attempts to insert SQL statements into a column of a list that your assembly uses to update a database, what mechanisms are you using to make sure the input is valid.&lt;br /&gt;&lt;br /&gt;·         Cross Site scripting attack: What is the effect of adding script to a column that your assembly uses to update another area in SharePoint?&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;2. Performance:&lt;br /&gt;&lt;br /&gt;Watch out for the following:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;·         Load: What burden are you placing on your web front end servers to run the assembly each time an event occurs? Use performance counters to determine this.&lt;br /&gt;&lt;br /&gt;·         Long Running Operations: Consider creating a custom SharePoint timer job. Kick off/ Schedule the Timer Job from the event rather than running all the logic inside the event. This will allow you to use the features of SharePoint to view whether the Timer Job ran successfully.&lt;br /&gt;&lt;br /&gt;·         Sync vs Async Events: Synchronous events have to wait until your code completes before returning the page, whereas Asynchronous events show the page immediately.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;3. Error Handling:&lt;br /&gt;&lt;br /&gt;When using synchronous events and you decide to cancel an event, let the user know why the event was cancelled. For example, update a Task List with a message why it failed.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Log your errors so that you can determine what issue is occurring when your system is in production environment. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;4. Connections: Cater for external systems being down when you are trying to connect to them. Don’t let your code / solution go belly up because you cannot connect to a database.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;5. Bulk Operations:&lt;br /&gt;&lt;br /&gt;The MSDN documentation mentions that event handlers will not fire when bulk operation is occurring. For example, when a new list is created, the FieldAdding event will not fire. &lt;br /&gt;&lt;br /&gt; Limitations of Event Handler in SharePoint&lt;br /&gt;&lt;br /&gt;Strangely there is no “SiteAdding”, “SiteAdded” event. However, if you really need this event you could create a “feature” to accomplish this. Features in SharePoint have a “FeatureActivated” event, where you could perform an action on creation of a site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-4649962284840460990?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/4649962284840460990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/deploying-event-receivers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4649962284840460990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4649962284840460990'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/deploying-event-receivers.html' title='Deploying event receivers'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-4676068334828104012</id><published>2009-12-17T05:02:00.001-08:00</published><updated>2009-12-17T05:02:42.196-08:00</updated><title type='text'>Very Good site about sharepoint</title><content type='html'>http://www.sharepointkings.com/2009/07/accessing-content-type-via-object-model.html&lt;br /&gt;http://www.sharepointkings.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-4676068334828104012?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/4676068334828104012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/very-good-site-about-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4676068334828104012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4676068334828104012'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/very-good-site-about-sharepoint.html' title='Very Good site about sharepoint'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-7267037518945512336</id><published>2009-12-16T23:36:00.000-08:00</published><updated>2009-12-16T23:38:47.578-08:00</updated><title type='text'>To check page is in edit mode or not for publishing page</title><content type='html'>This field can be used to check whether page is in edit mode or not &lt;br /&gt;&lt;br /&gt;&lt;input type="hidden" name="MSOLayout_InDesignMode" id="MSOLayout_InDesignMode" value="1" /&gt;&lt;br /&gt;&lt;br /&gt;By checking value of this hidden field we will come to know about page is in edit mode or not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-7267037518945512336?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/7267037518945512336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/to-check-page-is-in-edit-mode-or-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7267037518945512336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7267037518945512336'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/to-check-page-is-in-edit-mode-or-not.html' title='To check page is in edit mode or not for publishing page'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-5911918932930399175</id><published>2009-12-11T01:32:00.000-08:00</published><updated>2009-12-17T05:02:05.907-08:00</updated><title type='text'>Caml Query</title><content type='html'>Substracting 5 days from the current date in the caml query.&lt;br /&gt;&lt;br /&gt;SPSite site = new SPSite("http://url");&lt;br /&gt;SPWeb web = site.OpenWeb();&lt;br /&gt;SPList list = web.Lists["ListName"];&lt;br /&gt;string querystring = "&lt;WHERE&gt;&lt;GE&gt;&lt;FieldRef Name=\"StartDate\"/&gt;"&lt;br /&gt;    + "&lt;Value Type=\"DateTime\"&gt;&lt;Today OffsetDays=\"5\" /&gt;&lt;/Value&gt;&lt;/GE&gt;&lt;/WHERE&gt;";&lt;br /&gt;SPQuery query = new SPQuery();&lt;br /&gt;query.Query = querystring;&lt;br /&gt;DataTable table = list.GetItems(query).GetDataTable();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-5911918932930399175?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/5911918932930399175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/caml-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/5911918932930399175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/5911918932930399175'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/caml-query.html' title='Caml Query'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-7553416695203351009</id><published>2009-12-11T01:27:00.000-08:00</published><updated>2009-12-11T01:32:33.279-08:00</updated><title type='text'>Running code with elevated previliges</title><content type='html'>Often it is useful to write code which has the ability to perform tasks that the user executing the code cannot do. For example, you may want to capture feedback from a user through a custom web part and add that feedback to a SharePoint list that the user does not have access to directly. Since server-side code executes in the context of the current user, the attempt to write the list item would fail. &lt;br /&gt;&lt;br /&gt;The way around this is to use a method on SPSecurity called RunWithElevatedPrivileges. This method accepts an anonymous delegate which will contain all of the code you want to execute. Any code within this delegate will execute as the system account. &lt;br /&gt;&lt;br /&gt;// this code runs in the context of the user&lt;br /&gt;SPWeb web = SPContext.Current.Site.RootWeb;&lt;br /&gt;SPList list = web.Lists["My List"];&lt;br /&gt;&lt;br /&gt;// this code will run in the context of the system account&lt;br /&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;br /&gt;{&lt;br /&gt;   SPSite rootSite = new SPSite("http://myserver");&lt;br /&gt;   SPWeb rootWeb = rootSite.RootWeb;&lt;br /&gt;   SPList myList = rootWeb.Lists["My List"];&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;// now we're back to the user context&lt;br /&gt;int itemCount = list.ItemCount;&lt;br /&gt;&lt;br /&gt;One important thing to note is that only objects instantiated within the RunWithElevatedPrivileges code block will have the context of the system account. So objects created outside of that will still have the context of the current user - even if they are used within the RunWithElevatedPrivileges block. &lt;br /&gt;&lt;br /&gt;// create an object in the context of the user&lt;br /&gt;SPWeb web = SPContext.Current.Web;&lt;br /&gt;&lt;br /&gt;// run as system account&lt;br /&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;br /&gt;{&lt;br /&gt;   // this will execute as the current user, not the&lt;br /&gt;   // system account because it is accessing the web&lt;br /&gt;   // object which was instantiated outside of the &lt;br /&gt;   // RunWithElevatedPrivileges block&lt;br /&gt;   SPList myList = web.Lists["My List"];&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;Event Receivers &lt;br /&gt;RunWithElevatedPrivileges is often used in Event Receivers to perform some sort of automation. Event receiver methods are passed SPItemEventProperties objects which provide easy access to the current list, current list item, current web, etc. However, you cannot use these objects directly within a RunWithElevatedPrivileges block because they were instantiated outside in the context of the user. As a workaround, you can re-create these objects within the context of the system account. &lt;br /&gt;&lt;br /&gt;public override void ItemAdded(SPItemEventProperties properties)&lt;br /&gt;{&lt;br /&gt;   // start sys account context&lt;br /&gt;   SPSecurity.RunWithElevatedPrivileges(delegate()&lt;br /&gt;   {&lt;br /&gt;      // accessing the list item directly from the properties&lt;br /&gt;      // will execute as the end user - not the system account&lt;br /&gt;      properties.ListItem["Title"] = "Hello";&lt;br /&gt;&lt;br /&gt;      // instead, re-instantiate these objects using data from the&lt;br /&gt;      // properties, but not the actual objects themselves&lt;br /&gt;      SPSite site = new SPSite(properties.SiteId);&lt;br /&gt;      SPWeb web = site.OpenWeb(properties.RelativeWebUrl);&lt;br /&gt;      SPList list = web.Lists[properties.ListId];&lt;br /&gt;      SPListItem item = list.Items.GetItemById(properties.ListItemId);&lt;br /&gt;      item["Title"] = "Hello";&lt;br /&gt;&lt;br /&gt;      item.Update();&lt;br /&gt;   }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-7553416695203351009?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/7553416695203351009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/running-code-with-elevated-previliges.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7553416695203351009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7553416695203351009'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/12/running-code-with-elevated-previliges.html' title='Running code with elevated previliges'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-71571471959496319</id><published>2009-11-03T20:12:00.000-08:00</published><updated>2009-11-03T20:13:32.094-08:00</updated><title type='text'>Activating the feature at sub site level</title><content type='html'>Avoiding manual activation of feature at the sub-site (web) levels&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add the ID (GUID) of the feature in  Onet.xml file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-71571471959496319?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/71571471959496319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/activating-feature-at-sub-site-level.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/71571471959496319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/71571471959496319'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/activating-feature-at-sub-site-level.html' title='Activating the feature at sub site level'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-7578468666197678161</id><published>2009-11-03T20:09:00.000-08:00</published><updated>2009-11-03T20:11:24.278-08:00</updated><title type='text'>Feature activation for timer jobs</title><content type='html'>A SharePoint feature receiver based on timer job is created as a site collection feature and you try to activate the feature&lt;br /&gt;&lt;br /&gt;May throw the error message “EXECUTE permission denied on object 'proc_putObject'.&lt;br /&gt;&lt;br /&gt;This is because adding the timer job is done by the account that runs the application pool of your web application. This account normally does not have write / execute permissions in the configuration database.&lt;br /&gt;&lt;br /&gt;The best way to get around this is to change the scope of your feature to WebApplication. In a few examples on the internet, the feature is Site scoped. If you change it to WebApplication scope, you have to activate the feature in the Central Administration. The application pool that runs that web application has enough permission to do this. Of course you need to slightly modify the code of your feature receiver. Instead of casting the properties.Feature.Parent to a SPSite, you cast it to a SPWebApplication.&lt;br /&gt;&lt;br /&gt;http://www.tonstegeman.com/Blog/Lists/Posts/Post.aspx?List=70640fe5-28d9-464f-b1c9-91e07c8f7e47&amp;ID=82&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-7578468666197678161?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/7578468666197678161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/feature-activation-for-timer-jobs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7578468666197678161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/7578468666197678161'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/feature-activation-for-timer-jobs.html' title='Feature activation for timer jobs'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1786940935208425759</id><published>2009-11-03T20:05:00.000-08:00</published><updated>2009-11-03T20:06:24.757-08:00</updated><title type='text'>Sharepoint Tips and tricks</title><content type='html'>1) We can Use single Content Type for multiple Page Layouts.&lt;br /&gt;2) Always Use using(SPWeb/SPSite obj = new SPWeb()/SPSite() ) object. These two SharePoint object won't &lt;br /&gt; get release from memory by GC and need to deallocate those explicitly&lt;br /&gt;&lt;br /&gt;3) To Lock the block/method/event across the thread,&lt;br /&gt; Create global object of object class and lock it.&lt;br /&gt; private static readonly object objCentralLock = new object();&lt;br /&gt;&lt;br /&gt;public override void Execute()&lt;br /&gt;{&lt;br /&gt;  lock(objCentralLock)&lt;br /&gt;  {&lt;br /&gt;   ......&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) SPJobDefinition(Timer job) Feature Development.&lt;br /&gt;If the scope of feature is WebApplication then it will work fine. Otherwise it will throw database permission exception. &lt;br /&gt;If you change it to WebApplication scope, you have to activate the feature in the Central Administration. &lt;br /&gt;The application pool that runs that web application has enough permission to do this. &lt;br /&gt;Of course you need to slightly modify the code of your feature receiver. &lt;br /&gt;Instead of casting the properties.Feature.Parent to a SPSite, you cast it to a SPWebApplication.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;100) Default page limit of sharepoint web for Navigation is 50. OOTB&lt;br /&gt;&lt;br /&gt;to change this limit,Need to update web.config of perticular application.&lt;br /&gt;&lt;br /&gt;Add DynamicChildLimt="XXXX" as attribute for all providers&lt;br /&gt;1) GlobalNavSiteMapProvider&lt;br /&gt;2) CombineNavSiteMapProvider&lt;br /&gt;3) CurrentNavSiteMapProvider&lt;br /&gt;4) CurrentNavSiteMapProviderNoEncode&lt;br /&gt;&lt;br /&gt;XXXX is an integer number.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1786940935208425759?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1786940935208425759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/sharepoint-tips-and-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1786940935208425759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1786940935208425759'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/sharepoint-tips-and-tricks.html' title='Sharepoint Tips and tricks'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-1817438063158881417</id><published>2009-11-03T20:03:00.000-08:00</published><updated>2009-11-03T20:04:28.312-08:00</updated><title type='text'>Tips and tricks(ASP .Net)</title><content type='html'>ASP.NET 1) To access requested page url&lt;br /&gt;Page.Request.UrlReferrer.AbsoluteUri&lt;br /&gt;2) Not to save page in browser's Cache&lt;br /&gt;call Page.Response.Cache.SetNoStore();      Page.Response.Cache.SetAllowResponseInBrowserHistory(false);&lt;br /&gt;in Base Master file's OnLoad() event or Page_Load() of page load event&lt;br /&gt;3) To post any data as a Form's POST method use following class&lt;br /&gt; 3.1) First need to call Add() method to set fields name and values&lt;br /&gt;Note: If it is asp.net target site and not handled Remote form posting request in Page_Load() then need to pass __ViewState value as parameter and also submit button type and ID should match to remote site page submit button. In this case remote site's button click event will get triggered automatically.&lt;br /&gt; 3.2) Post() method to post requset&lt;br /&gt;public class RemotePost    {        string url;        private System.Collections.Specialized.NameValueCollection Inputs = new System.Collections.Specialized.NameValueCollection();        public string Url { get { return url; } set { url = value; } }        public string Method = "post";        public string FormName = "TestForm";        public void Add(string name, string value)        {            Inputs.Add(name, value);        }&lt;br /&gt;        public void Post()        {            try            {   //Clear old respose                System.Web.HttpContext.Current.Response.Clear();                System.Web.HttpContext.Current.Response.Write("&lt;html&gt;&lt;head&gt;");                                System.Web.HttpContext.Current.Response.Write(string.Format("&lt;/head&gt;&lt;body&gt;"));                System.Web.HttpContext.Current.Response.Write(string.Format("&lt;form name="\" method="\" action="\" target="\"&gt;", FormName, Method, Url));  //Add all parameters as html input hidden controls with id,name and value                for (int i = 0; i &lt; name="\" id="\" type="\" value="\"&gt;", Inputs.Keys[i], Inputs[Inputs.Keys[i]]));                }  //Hide submit button                System.Web.HttpContext.Current.Response.Write(string.Format("&lt;div style="\"&gt; &lt;input name="\" id="\" type="\" value="\"&gt;&lt;/div&gt;"));                System.Web.HttpContext.Current.Response.Write("&lt;/form&gt;");  //trigger submit button click event using javascript click() method                System.Web.HttpContext.Current.Response.Write("&lt;script&gt;document.getElementById(\"Button1\").click(); &lt;/script&gt;");                System.Web.HttpContext.Current.Response.Write("&lt;/body&gt;&lt;/html&gt;");  //Complete request                HttpContext.Current.ApplicationInstance.CompleteRequest();               &lt;br /&gt;            }            catch (Exception ex)            {&lt;br /&gt;                throw ex;            }&lt;br /&gt;        }    }&lt;br /&gt;4) Force browser to download file(image filem .js or .css etc) from server then need to add querystring parameter where we have referening perticular filee.g.   &lt;script scr="library/CustomValidation.js?Version=1" langauge="javascript" type="text/javascript"&gt;&lt;/script&gt;Here we are passing ?Version=1 value as a query string parameter and if file name from browser's temp folder and this mismatch thenbrower will download file from server and will refer latest one.If you modify CustomValidation.js file then you can add Version=2 value as query string parameter&lt;br /&gt;This problem is mostly with IE 7.0 brower.&lt;br /&gt;5) To determine who caused postback, use Request.Form["__EVENTTARGET"]. It holds the UniqueID of the control that caused postback.If the control is a button, its UseSubmitBehavior must be set to false. So in case you are getting nulls, you probably have UseSubmitBehavior=true.&lt;br /&gt;6) Not to ask Remember Password or any field by any browser  Add Autocomplete=off Attribute(like ControlID.Attribute.Add("Autocomplete","off");) to the User ID Textbox control.&lt;br /&gt;7) Allow User to Read/Write/Delete disk file even if another user is using, Use FileShare mode with FileStream object as shown below.&lt;br /&gt;using (FileStream fs = new FileStream("C:\\dat.txt", FileMode.Create, FileAccess.Write,                FileShare.Write  FileShare.Read  FileShare.Delete))            {                while (true)                {                    fs.WriteByte(84);                    fs.Flush();                    Console.Write(".");                    Thread.Sleep(1000);                }            }&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-1817438063158881417?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/1817438063158881417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/tips-and-tricksasp-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1817438063158881417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/1817438063158881417'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/11/tips-and-tricksasp-net.html' title='Tips and tricks(ASP .Net)'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-975608374001069048</id><published>2009-10-25T20:54:00.000-07:00</published><updated>2009-10-25T21:08:32.443-07:00</updated><title type='text'>Page Layouts</title><content type='html'>Yesterday i faced a problem related to the page layout. I created a page layout with SummaryLinkFieldControl and its works fine with users having admin permission but for user having less previliges its throwing access denied error.&lt;br /&gt;After searching in the net i came to know that its a problem with summary link web part.&lt;br /&gt;The reason behind this may be safe control entry may not be there in the web config file(Its a just guess)&lt;br /&gt;Its better to have web part zone where we can add summary link web part.&lt;br /&gt;In google try to search with the key&lt;br /&gt;(SummaryLinkFieldControl)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-975608374001069048?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/975608374001069048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/10/page-layouts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/975608374001069048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/975608374001069048'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/10/page-layouts.html' title='Page Layouts'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-4200069530200214832</id><published>2009-09-24T20:30:00.000-07:00</published><updated>2009-09-24T20:48:34.195-07:00</updated><title type='text'>How to refresh application pool without resetting iis</title><content type='html'>This is the common scenario in sharepoint development. Suppose if you modify site definition file(xml) or you need to deploy the latest dll in GAC, then iisreset is must to get the changes.&lt;br /&gt;But the thing is if the deployment is in production server then your customer may raise a issue. If server contains more than one application then its bad idea to give iisreset. Instead of that you can reset the application pool where your application is running.&lt;br /&gt;For this we require the application pool id. How to get the application pool id?&lt;br /&gt;Type the below line of text in command prompt.&lt;br /&gt;C:\windows\System32\iisapp&lt;br /&gt;This will display all the application pool id. Easily you will come to know about your app pool Id.&lt;br /&gt;Next step is to refresh the application pools.&lt;br /&gt;Type the following line in command prompt, that will refresh the app pool.&lt;br /&gt;C:\windows\System32\iisapp.vbs /a “ApplicationName” /r&lt;br /&gt;Another way is create one batch file and paste the following line of code.&lt;br /&gt;C:\windows\System32\iisapp.vbs /a “ApplicationName” /r&lt;br /&gt;pause&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-4200069530200214832?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/4200069530200214832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/how-to-refresh-application-pool-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4200069530200214832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/4200069530200214832'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/how-to-refresh-application-pool-without.html' title='How to refresh application pool without resetting iis'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-3372857879671123599</id><published>2009-09-23T20:59:00.000-07:00</published><updated>2009-09-23T21:13:21.302-07:00</updated><title type='text'>Deleting Items in a sharepoint list</title><content type='html'>How to delete items in sp list?&lt;br /&gt;Whenever we are thinking about this scenario, suddenly the code comes in the mind is create foreach loop and loop through each items and delete the items.&lt;br /&gt;But the problem is we cannot the the list items by this way. It will give the error like "Collection was modified; enumeration operation may not execute."&lt;br /&gt;So to overcome this problem we need to write the code in differently.&lt;br /&gt;&lt;br /&gt;int iCount = list.Items.Count;//Its allways better practice to assign the the count to some variable if we use list.Items.Count in for loop it will get the count record from database as many times as for loop will run.&lt;br /&gt;int j ;&lt;br /&gt;for(int i=iCount-1; i&gt;=0;i--)&lt;br /&gt;{&lt;br /&gt;j = i;&lt;br /&gt;list.Item[j].Delete()&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Same logic will be applied to all share point collection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-3372857879671123599?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/3372857879671123599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/deleting-items-in-sharepoint-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3372857879671123599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/3372857879671123599'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/deleting-items-in-sharepoint-list.html' title='Deleting Items in a sharepoint list'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-2186499375155455437</id><published>2009-09-22T02:14:00.000-07:00</published><updated>2009-09-22T02:29:12.210-07:00</updated><title type='text'>Event Handlers</title><content type='html'>&lt;p&gt;Difference between workflows and event handlers&lt;/p&gt;&lt;p&gt;1) Event handlers  will trigger automatically where as workflows can be in either way.&lt;/p&gt;&lt;p&gt;2)User interaction is not there in event handlers where as opposite in workflows.&lt;/p&gt;&lt;p&gt;3) Event handler run for short duration where as workflows run for long duration&lt;/p&gt;&lt;p&gt;4) Workflows will be avalable after system down(maintainace,IISRESET etc) but this is not possible in event handler&lt;/p&gt;&lt;p&gt;There is no event for site created but site deleting and site deleted events are available.&lt;/p&gt;&lt;p&gt;To handle/run some custom code whenever a site is created.&lt;br /&gt;Create a Feature that has an Event Receiver defined on it and call the Feature activation event.(There we can run code) Then, use a Feature Staple to staple your Feature to the GLOBAL site definition. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-2186499375155455437?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/2186499375155455437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/event-handlers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2186499375155455437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/2186499375155455437'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/event-handlers.html' title='Event Handlers'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-762936358880048492.post-636178681500669001</id><published>2009-09-18T05:10:00.000-07:00</published><updated>2009-09-18T05:12:48.997-07:00</updated><title type='text'>Sharepoint Development Links</title><content type='html'>In this blog i am providing only the links and good articles where it will be usefull for sharepoint developers and also some code snippets to do an workaround.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/762936358880048492-636178681500669001?l=srisharepointdevelopment.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://srisharepointdevelopment.blogspot.com/feeds/636178681500669001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/sharepoint-development-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/636178681500669001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/762936358880048492/posts/default/636178681500669001'/><link rel='alternate' type='text/html' href='http://srisharepointdevelopment.blogspot.com/2009/09/sharepoint-development-links.html' title='Sharepoint Development Links'/><author><name>Sri</name><uri>http://www.blogger.com/profile/18025648899200792393</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
