tag:blogger.com,1999:blog-43729760205096631552024-03-12T20:40:08.903-07:00Sharepoint LeadSharepoint Tutorials, Tips and tricks, development, analysis, administration, and much morePrashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-4372976020509663155.post-30213271604901421342014-11-27T01:48:00.001-08:002014-11-27T01:48:44.941-08:00Visual studio hangsMy visual studio 2012 became really really slow when editing ascx file. In entire of my solution there was only 1 web part and bunch of other cs and other important files. I noticed when I am editing ascx file it was really really slow and unresponsive after every couple of seconds.<br />
<br />
I found that when you have some urls that uses //somescript.path.js instead of http:// or https:// to allow browser to auto resolve protocol, that is happening.<br />
<br />
After reading this somewhere on web, I changed my code to use Request.Url.Scheme in order to dynamically choose protocol instead of using // in the starting and problem was resolved. <br />
<br />Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-13949059334055024492014-11-27T01:44:00.000-08:002014-11-27T01:44:03.417-08:00g.cs - How it works!I recently found during my deployment that once of my visual web part's ascx content is not updated in the staging environment when I deploy wsp!<br />
<br />
So, I started searching for my ascx file in 14 hive but did not find it anywhere. That became really frustrating when I was not able to find ascx file in my local farm's 14 hive as well! I did some google searching for g.cs and most of the results were either complaining about "can not find Initialize control" or they got a blank g.cs file!<br />
<br />
Then I went ahead and looked into the source code for the g.cs file and I found that for each of your control in ascx, its actually generating elements. For static content, its concatenating to string variable and for all server controls, its generating code and setting properties. I recall doing same in classic web parts without ascx controls and my question was answered.<br />
<br />
So, g.cs file is c# version of your ascx code so that it doesn't have to deploy ascx control in file system but instead works just like a classic web part!<br />
<br />
Well, in that case, it should work as sandbox solution as well, right? I did not tried it but ideally yes if your code is following limitations for sandbox solutions.<br />
<br />
Now the original problem was:<br />
In our organization we use source control system. Upon pull, I got conflicts and I correctly merged ascx file but not properly merged g.cs file considering its useless and visual studio automatically handles it when I will open project.<br />
<br />
But that wasn't true. After doing this, when I publish/deploy my wsp, visual studio will not regenerate that file again on build/publish/deploy. It only generates g.cs file again when you hit save in ascx control. That was the answer of my problem.<br />
<br />
So, never ignore ascx.g.cs files in your solution, always make sure you merge g.cs files OR after every conflict you hit save in your ascx to regenerate ascx.g.cs file again! That's what I conclude.<br />
<br />
I hope this will be helpful to you all!Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-68445133692471195462014-11-27T01:29:00.001-08:002014-11-27T01:29:58.204-08:00iCal - Cancel 1 meeting from recurring meetingsI was working on generating an iCAL invite from a calendar item and was having difficulty deleting once of the event from series.<br />
<br />
I found that you have to generate the same ICAL invite that you did for recurring event but there will be two things different<br />
<ol>
<li>Add Recurrence-ID;Value:DATE=yyyyMMDD (your get the value from SPListItem["ReucurrenceID"])</li>
<li>Change the METHOD in your email and ical content to CANCEL</li>
<li>Increment sequence parameter</li>
</ol>
Once you adjust your cancel invite with these three changes, your email will show remove from calendar link and clicking on it will only remove the event specified in Recurrence-ID.Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-19834529342671753732014-07-25T21:40:00.000-07:002014-07-25T21:41:20.913-07:00Cross site list view web part anywhere in site collection<h3>
Introduction</h3>
There are times when you want to display list/library from root level site collection or visa-versa to sub-site but stuck because sharepoint don't provide list view web part that can be shown across sub sites. If you are in same site collection, its possible with the trick I am going to share.<br />
<br />
<h3>
Step 1 - Create a page and drop list view web part there</h3>
<div>
Create a page in the site/web where you got the list/library and drop the list view web part into that page and save the page.</div>
<div>
<br /></div>
<h3>
Step 2 - Export lsit view web part</h3>
<div>
If you try to see the edit menu for the web part and there is a link called "Export" you can directly export and download the web part.</div>
<div>
<br /></div>
<div>
If you can not see "Export" option in the web part menu, you have to do following:</div>
<div>
<ul>
<li>Right click on the web part content heading that shows list/library fields and click on inspect element (IE9+, chrome, firefox and other popular browsers)</li>
</ul>
</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht4hf5vguvrlzNd-9I6KZyeenh5ifvZi8WuBZHgBclGgZ-apm5LIGgiviZirtKyENnMNV6Nr7wUm5kADPWpZTAnjlBAV4ZDbLG1Lo5wyc7ZKfAHqSUL68jVrHw5eeUGs3PHZkdWojAqvRV/s1600/wp-guid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht4hf5vguvrlzNd-9I6KZyeenh5ifvZi8WuBZHgBclGgZ-apm5LIGgiviZirtKyENnMNV6Nr7wUm5kADPWpZTAnjlBAV4ZDbLG1Lo5wyc7ZKfAHqSUL68jVrHw5eeUGs3PHZkdWojAqvRV/s1600/wp-guid.png" height="112" width="640" /></a></div>
<ul>
<li>Once you are ready with web part id, you can use following url to export the web part</li>
</ul>
</div>
<blockquote class="tr_bq">
http://<b>root-site-url</b>/_vti_bin/exportwp.aspx?pageurl=<b>page-url</b>&guidstring=<b>web-part-guid</b></blockquote>
<div>
<h3>
Step 3 - Set Web ID</h3>
</div>
<div>
<ul>
<li>Switch to powershell and get guid of the web where the list exists. $w = Get-SPWeb -identity <b>url-of-web;w.ID</b></li>
<li>Open exported .webpart file and find WebID property and set value of the guid you get to the value in WebId node in web part file.</li>
</ul>
<h3>
Step 4 - Upload it to web part gallery</h3>
</div>
<div>
<ul>
<li>Go to site settings > Galleries > web part galleries</li>
<li>click on upload and upload your web part file here and set title, group and description of the web part</li>
</ul>
<h3>
Step 5 - Finished</h3>
</div>
<div>
<ul>
<li>Go to anywhere in your site collection and add the web part. It will show you the list view web part that you uploaded in specific group.</li>
</ul>
<h3>
Limitations:</h3>
</div>
<div>
I tested this with list/libraries having html as default view and rendering of the list view web part works. There are lots of functions associated with the list/library that can be performed from ribbon that I have not tested. Please make sure you consider that while using this trick.</div>
Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-86972459176151099512014-04-23T03:31:00.002-07:002014-04-23T03:31:54.232-07:00ascx.g.cs Empty<b>Bug:</b><br />
In Visual Studio 2012, when you are working with a visual web part, your user control's ascx.g.cs file becomes empty. So you get an error "The name ‘InitializeControl’ does not exist in the current context".<br />
<br />
<b>Root cause:</b><br />
This is reported as a bug in visual studio 2012 and it generally happens when your server side mark up is having issues. This ONLY happens when you are editing your ascx file.<br />
<br />
<b>Suggested Solution:</b><br />
You can try following:<br />
Short way:<br />
<br />
<ul>
<li>try to undo some of the last changes in ascx file.</li>
<li>Create copy of ascx file and revert it from source control. Rename g.cs to g.txt and switch to ascx and hit save. That will generate another g.cs with correct content</li>
</ul>
<br />
Long way:<br />
<br />
<ul>
<li>Please check the @Register declarations against the TagPrefix and TagName that you are using.</li>
<li> Try to comment out all controls in ascx and save it. That will generate ascx.g.cs along with content again. Now start un-commenting the controls one by one.</li>
<li>In worst cases, after trying lots of things people also switch to new web part and migrate useful code from the problematic web part step by step to resolve the error. </li>
</ul>
<div>
<br /></div>
Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-90771783447123716932014-04-16T21:01:00.001-07:002014-04-16T21:08:46.727-07:00Keep it upSometime back when Rajasthan Royals won the first IPL, I was working with Virtual Lifestyle Pvt Ltd, and CEO Vikas Sabnani explained how Rajasthan Royals being a cheapest team, won the game. Here are three things that he noticed that applies to every team and team players of the world.<br />
<br />
<ol>
<li>Focus on Quality<br />Being an important member of the team, if you do so, you are not achieving for yourself and team at the same time. Focusing on quality is as easy as you read it.</li>
<li>Be Proactive<br />Here is what the definition says: "creating or controlling a situation rather than just responding to it after it has happened." There are great example of proactive work but in our software world, detecting & fixing or implementing stuff ahead of time with the best suited and most efficient way</li>
<li>Have fun!<br /> Having fun with what you do is also as important as the other two.</li>
</ol>
If you are doing it all three together, you are doing it right! If not, what are you waiting for?
Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-76142562004282507732013-01-06T01:57:00.000-08:002014-05-25T02:23:18.543-07:00System.ArgumentException: Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValueI was configuring one of our clients farm which required FBA on different web applications (around 5) and he wanted each web application should have separate user store. That was too tricky since you just need to set up <em><span style="font-family: Courier New;">Application </span></em>property of the membership provider and you are done.<br />
After completion of these settings, all of my applications were having a common exception either in log out or login to the web application. Here was the exception.<br />
<blockquote>
<span style="font-family: Courier New; font-size: x-small;">System.ArgumentException: Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue) at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix) at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix) at Microsoft.SharePoint.Utilities.SPUtility.GetFullUserKeyFromLoginName(String loginName) at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers) at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</span></blockquote>
After checking all my steps right through starting. After getting all the other exeptions cleared the above exception was the only exception that I was getting. That was resolved using <a href="http://sharepoint.stackexchange.com/questions/23996/exception-of-type-system-argumentexception-was-thrown-got-error-when-i-have" target="_blank">"Exception of type 'System.ArgumentException' was thrown" got error when i have signout from webapplication in sharepoint 2010?</a>.<br />
I hope this will help to you if you are getting same error due to a silly custom property of a custom web part for registration!<br />
<br />
<h2>
Update - 5/19/2014</h2>
<div>
There are several solutions that I tried:</div>
<div>
<ul>
<li>Solution that is mentioned here: <a href="http://sharepoint.stackexchange.com/questions/23996/exception-of-type-system-argumentexception-was-thrown-got-error-when-i-have" target="_blank">Exception of type 'System.ArgumentException' was thrown" got error when i have signout from webapplication in sharepoint 2010?</a></li>
<li>In Central Administration, Application Management - select web application and in user policy, for the specific zone where you have problem (or default zone) try to remove and add all authenticated users and all fba users full read and make sure none of the AD users are showing in Domain\username format.</li>
</ul>
<div>
The same error also encountered again reported by client when he tries to enable intranet through internet explorer settings. Disabling detection of intranet from internet options solves that issue but you are forced to enter username password every first visit of the site even in intranet as well!</div>
</div>
<div>
<br />
<h2>
Update - 5/25/2014</h2>
<div>
This is a SharePoint bug also found some discussion here: <a href="https://sharepoint2013fba.codeplex.com/workitem/9">https://sharepoint2013fba.codeplex.com/workitem/9</a> </div>
<br /></div>
<div>
Hope this helps</div>
Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com5tag:blogger.com,1999:blog-4372976020509663155.post-32619035586588419862012-12-30T20:01:00.001-08:002012-12-30T20:01:13.050-08:00SharePoint 2010 foundation on windows 7<p>If you are planning to install SharePoint 2010 foundation in your windows 7 machine, there are very good references out there in many blogs. But after I installed it I was not able to create new web applications.</p> <p>I noticed, I was an administrator account with different name than administrator. I found <a href="http://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/" target="_blank">here</a> that we can enable in built administrator account.</p> <p>I enabled administrator account and added it to managed accounts and farm administrators group.</p> <p>After trying so many things from forums, finally I got everything working in SharePoint Foundation in my machine!</p> Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-55129442947797792732012-12-28T05:21:00.000-08:002012-12-28T05:21:06.116-08:00SharePoint 2013 FBA PackI tried to install <a href="https://bitbucket.org/plakhlani/sharepoint-2013-fba/overview">SharePoint 2010 FBA Pack</a> in SharePoint 2013 and it was working almost OK. I started facing some minor issues and I fixed them one by one.<br />
<br />
Entire solution with my fixes is available as a <a href="http://www.bitbucket.org/" target="_blank">BitBucket</a> repository <a href="https://bitbucket.org/plakhlani/sharepoint-2013-fba/overview" target="_blank">here</a><br />
<br />
Following are list of issues and how I fixed them.<br />
<br />
<ol>
<li>When you go to add new user from user manager, and click on cancel, it was showing error<br /><b>Solution: </b><br />
Replaced code <pre class="csharp">string url = "FBA/Management/UsersDisp.aspx";
SPUtility.DetermineRedirectUrl(url,SPRedirectFlags.RelativeToLayoutsPage, this.Context,null, out url);</pre>
with <pre class="csharp">string url = "/_layouts/FBA/Management/UsersDisp.aspx";
//SPUtility.DetermineRedirectUrl(url,SPRedirectFlags.RelativeToLayoutsPage, this.Context,null, out url);</pre>
So, in nutshell, when you are using the previous code, it redirects to /_layouts/15/FBA/UserDisp.aspx and our actual path is in 14 folder.
</li>
<li>Similar redirection problems where there when you click edit user and click on cancel, click on reset password and click on cancel etc. I fixed them all by replacing SPUtility.Redirect to Response.Redirect</li>
<li>Use of upgraded user controls.<br />When you go to any page, for example UserNew.aspx, you will notice that there are controls used in the page that are registered from "_controltemplates/xxxx.ascx", I upgraded them to use "_controltemplates/15/xxxx.ascx.<br />You must be wondering how did I come to know about this? I looked at the page in 15 hive's admin folder and some random aspx page over there, I noticed the new path.</li>
<li>Last one was, Due to SharePoint 2013 titles, breadcrumbs where causing long scroll. I updated resource file to update titles. I just updated titles and used "Manage Users", "Add Users" in place of using all long titles that are used out of the box.</li>
<li>When I tried to package the solution after changes are done, It was giving me too long path error, so I renamed project name and package name to FBA. You will still able to install/upgrade it using <b>stsadmin</b> command.</li>
</ol>
<div>
This are really simple and small fixes, and only contains minor changes that make you able to work. If you have any other bugs, just post it to the public BitBucket repository that I have created and I will try to help you.</div>
<div>
<br /></div>
<div>
In next couple of posts we will discuss about adding customer properties through profile provider. If you have any other sugessions or feedback, I will be more than happy to hear back.</div>
Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-72005310694551425182012-07-04T01:05:00.001-07:002012-07-04T01:05:32.508-07:00Not able to change page layout<br />
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px; margin-bottom: 1em;">
<strong>Problem:</strong></div>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px; margin-bottom: 1em;">
Due to some problem in page, Page Layout button in ribbon is showing disabled.</div>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px; margin-bottom: 1em;">
<strong>Solution:</strong></div>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px; margin-bottom: 1em;">
Use following as QUICK solution if you are creating a new page:</div>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px; margin-bottom: 1em;">
</div>
<ol style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px;">
<li>Delete newly created page</li>
<li>Go to site settings > Page Layouts and Templates</li>
<li>Locate "New page defualt settings" and select the page layout that you want to set as default page layout.</li>
<li>Save setting</li>
<li>Create new page</li>
</ol>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px;">
There can be many reasons of Page Laout showing disabled in ribbon. You can reference following links to go deeper and resolve it properly.</div>
<div style="color: #4c4c4c; font-family: Verdana, Arial, sans-serif; font-size: 11px; line-height: 18px;">
<ol>
<li>Try check out the page and then go to edit mode of the page.</li>
<li>Try different browsers to change page layout</li>
<li><a href="http://osric.com/chris/accidental-developer/2011/11/updating-a-sharepoint-pages-page-layout-using-powershell/" style="color: #b10069; text-decoration: none;" target="_blank">Change page layout using powershell</a></li>
<li><a href="http://code-journey.com/2011/cant-change-page-layout-this-control-is-currently-disabled/" style="color: #b10069; text-decoration: none;" target="_blank">Reference link 1</a></li>
</ol>
</div>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-69224009605445296192012-07-02T03:00:00.000-07:002012-07-02T03:04:36.414-07:00SMTP4DEV: Your sharepoint 2010 out going email server for development farmIf you are having standalone sharepoint 2010 development farm on window7 64bit, and looking for good option, <a href="http://smtp4dev.codeplex.com/" target="_blank">SMTP4DEV</a>. It is a free tool. You will need around 10mins and then you can start receiving emails from sharepoint farm! Here are quick steps:<br />
<br />
<ol>
<li>Download
<a href="http://smtp4dev.codeplex.com/" target="_blank">SMTP4DEV</a> from it's codeplex project site, I prefer standalone exe but you can download installer as well.</li>
<li>If you like to use some custom local domain, click on options and set up some local domain like local.machinename.com.<a href="http://www.ehow.com/how_5225562_edit-windows-hosts-file.html" target="_blank"> Create host entry</a> pointing to 127.0.0.1</li>
<li>By completing these many steps you can now send emails through
<a href="http://smtp4dev.codeplex.com/" target="_blank">SMTP4DEV</a> by any url ending in @local.machinename.com</li>
<li>Go to sharepoint central administration > System settings > setup outgoing email server.</li>
<li>set local.machinename.com as server, and provide any email ending in @local.machinename.com </li>
<li>Save your settings</li>
</ol>
<div>
After these minimum set of configuration you will be able to start sending emails. Beauty of <a href="http://smtp4dev.codeplex.com/" style="background-color: white;" target="_blank">SMTP4DEV</a> is:</div>
<div>
<ol>
<li>It will show you notification that new email is sent</li>
<li>It will show you all emails sent from the smtp in UI without actually sending it</li>
<li>You can inspect email</li>
<li>You can view email (in email client that you set default)</li>
</ol>
<div>
So, in conclusion, it is a best choice KISS kind of solution for your sharepoint 2010 development farm's outgoing SMTP server.</div>
</div>
<div>
<br /></div>
<br />
<br />
<br />Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com3tag:blogger.com,1999:blog-4372976020509663155.post-86520118148298450142012-07-02T02:46:00.001-07:002012-07-02T02:47:18.640-07:00Sharepoint 2010: TryGetList vs GetList<span style="font-family: inherit;">As a developer, you will say GetList can throw exception but TryGetList will not. It is actually confusing because <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistcollection.trygetlist.aspx">TryGetList</a> looks for listTitle and returns null if list is not available at expected location. <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getlist.aspx">GetList</a> will expect listUrl and can throw <a href="http://msdn2.microsoft.com/EN-US/library/dzyy5k3x" style="color: #960bb4; font-size: 13px; line-height: 18px; text-align: left; text-decoration: none;" target="_blank">FileNotFoundException</a> or <a href="http://msdn2.microsoft.com/EN-US/library/3w1b3114" style="color: #960bb4; font-size: 13px; line-height: 18px; text-align: left; text-decoration: none;" target="_blank">ArgumentException</a> if list is not present at expected location or relative/absolute url of list is invalid relatively. Another biggest difference is they belong to different class!</span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;">Apart from all those technical details, I noticed that many sharepoint administrators likes to start with a simple list/library name and eventually change it to make it as close as possible to what they do. That will make list/library url and their names different. Here comes the actual problem. If you are actually using list/library names in your code, it will no longer work. OR we can say you are not allowing sharepoint administrators to change name of list/library that they have created. </span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;">By using GetList you are actually giving them flexibility to use whatever name they like to use, as far as they are not changing url or list/library code will still work.</span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;">In conclusion, it really depends on requirements how you are going to deal with the situation but it is good to keep in mind that you can use GetUrl function in your code to allow sharepoint administrators to change their names without worrying about breaking functionality.</span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;"><br /></span><br />
<br />Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-87187934576645067052012-06-22T06:16:00.000-07:002012-06-22T06:16:21.958-07:00How to use soapUI to review ListData.svc<br />
<h3>
Introduction</h3>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
SoapUI is a free tool that can be used to test out of the box ListData.svc service provided by sharepoint. This service is available at /_vti_bin/ListData.svc for any of your sharepoint site. Here is how we can try it out using SoapUI.</div>
<h4>
Step 1: Install sopa UI and click on File > New SoapUI Project. Add some project name and check "Add REST Seervice:" like shown in following figure and then click OK</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiypDiE1BQTrYQR0niO7T4fSzvEBi4yu3kFcIUM7OWeNCKImwNSeTjpxO_ktSe7OqWy0q0bpdZbon56BkDv7i4SnQUKd8Jeln13vb1NdRGV2WaX09jglZKiF9BT_ilHKGZViR5M6klvzbSV/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiypDiE1BQTrYQR0niO7T4fSzvEBi4yu3kFcIUM7OWeNCKImwNSeTjpxO_ktSe7OqWy0q0bpdZbon56BkDv7i4SnQUKd8Jeln13vb1NdRGV2WaX09jglZKiF9BT_ilHKGZViR5M6klvzbSV/s320/1.png" width="320" /></a></div>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;"><br /></span><br />
<h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">Step 2: After clicking on OK another window will open like following, just click on OK</span></h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;"><br /></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUmG4GhUZamGSJF2bU7kWbbcglGT92kVRk6Jldpvgvo0uJgi1W_ObZEK6hUSLy24_aBnCJ7mqD1agZB4es8R8VQCV565OJ_4D6Zsz8jInOLyiol-qtBhBrrTGlHhY4jdL6vXSifCVk_h-O/s1600/soapUI-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUmG4GhUZamGSJF2bU7kWbbcglGT92kVRk6Jldpvgvo0uJgi1W_ObZEK6hUSLy24_aBnCJ7mqD1agZB4es8R8VQCV565OJ_4D6Zsz8jInOLyiol-qtBhBrrTGlHhY4jdL6vXSifCVk_h-O/s320/soapUI-2.png" width="320" /></a></div>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
<br /></div>
<h4>
<span style="background-color: white;">Step3: New REST resource window will appear. In resource name enter site url and in resource path/endpoint provide list/document library name and click on "Extract params" button. Following is the screen that shows sample data.</span></h4>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRt_4TyHWC6Q8fBtim-aIKAUH521L7pyNwyXnP9_vlTAKL4jbdfugKjplldBd8-l2XKYeszB6TucCGNYsodEUtY0rr4U1a2S6rbUWVbnyaiuFM3SfOV-SCbaqS2sd-TqBy5ii-fS91DQ/s1600/soapUI-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFRt_4TyHWC6Q8fBtim-aIKAUH521L7pyNwyXnP9_vlTAKL4jbdfugKjplldBd8-l2XKYeszB6TucCGNYsodEUtY0rr4U1a2S6rbUWVbnyaiuFM3SfOV-SCbaqS2sd-TqBy5ii-fS91DQ/s320/soapUI-3.png" width="320" /></a></div>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
<br /><br /></div>
<h4>
Step4:That will automatically create a new request called Request 1.This request will automaticlaly detect endpoint and path to your list/document library. If it is not, just click on"-no endpoint set-" and click on add new endpoint. Enter site url in the dialog again.</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKaAJ6ug7PIAX1tKMOUEzn016AWs2J5bIrWZYuEY010TzyEmHjMEtP9CZnIjOpxH0725bH6imQ2UCH67dwJntGMR7Fs4FrSMCGsOiXyCg7Ajd14-EU6cVeQncx4P_mkwSmPFgUaRFwmixD/s1600/soapUI-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKaAJ6ug7PIAX1tKMOUEzn016AWs2J5bIrWZYuEY010TzyEmHjMEtP9CZnIjOpxH0725bH6imQ2UCH67dwJntGMR7Fs4FrSMCGsOiXyCg7Ajd14-EU6cVeQncx4P_mkwSmPFgUaRFwmixD/s320/soapUI-4.png" width="320" /></a></div>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
<br /><br /></div>
<h4>
Step5: Maximize "Request 1" window in soapUI. In botton left corner you will see " ... ", click on it and you will be able to provide sharepoint authentication details there.</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5TNMK7QSchRfGGWdh8DBuJHiTQvf7CGvXSpQBSnIwSyahER7cHAyeQIu6MyC40KA6RZgGW9y5fCXk3wVWrFl1qUUGOjtbB647ocjYIBZCajew1Z7jkI-zzCvNmM1Yh9R4E3xGz3v1EJE/s1600/soapUI-5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5TNMK7QSchRfGGWdh8DBuJHiTQvf7CGvXSpQBSnIwSyahER7cHAyeQIu6MyC40KA6RZgGW9y5fCXk3wVWrFl1qUUGOjtbB647ocjYIBZCajew1Z7jkI-zzCvNmM1Yh9R4E3xGz3v1EJE/s320/soapUI-5.png" width="137" /></a></div>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
<br /><br /></div>
<h4>
Step6: Once you are done with authentication details you can click on execute icon at top left corner of "request 1" window (marked in above figure) to execute the request and you will be able to see response at right hand side window.</h4>
<h4>
Step7: ListData.svc can also return json data in response out of the box. Just try to provide accept = application/json like shown in figure below:</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXP5DAYfn_nYmeka_lNUN6MM4bf4oU9cjRM9SchfukOqFhRv5YCsT8seiFXArLQV9z9xHcqOy1sU-tHzSoT1UtSqp5d80XcHTqr9jJEi9TMW6S0XmH_0WxtGUBExRdQws0fBSSe_GVwaFK/s1600/soapUI-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXP5DAYfn_nYmeka_lNUN6MM4bf4oU9cjRM9SchfukOqFhRv5YCsT8seiFXArLQV9z9xHcqOy1sU-tHzSoT1UtSqp5d80XcHTqr9jJEi9TMW6S0XmH_0WxtGUBExRdQws0fBSSe_GVwaFK/s320/soapUI-7.png" width="320" /></a></div>
<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
<br /></div>
<h4>
Conclution:<br />SoapUI is a super simple too to try out and it will be really help to review xml/json data while you are planninig to consume it with jQuery. </h4>
<br />Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com5tag:blogger.com,1999:blog-4372976020509663155.post-62782672541522085292012-05-28T23:46:00.000-07:002012-05-29T02:40:12.570-07:00CAML Designer: Try it now!When you want to
design/test your caml query, most of the time uses <a href="http://www.u2u.be/res/tools/camlquerybuilder.aspx" target="_blank">U2U CAML Query builder</a>. Sometimes you get
problem with connection but most of the time, it was working fine for most of
the needs.
<br />
<br />
Recently, I tried <a href="http://karinebosch.wordpress.com/my-articles/caml-designer/" target="_blank">CAML Designer</a> which is
really nice tool to try as alternative. WPF UI experience with many additional
features may impress you to switch to this new tool.
<br />
<br />
Let me know your
experience while evaluatingPrashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-88905398578728419432012-05-17T02:16:00.002-07:002012-05-17T02:32:36.286-07:00PowerGUI script editor: powershell debugging and intellisense<div style="color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
In this post I am going to show you how to use <a href="http://www.powergui.org/" style="color: #b10069; text-decoration: none;">PowerGUI script editor</a> for executing powershell. There are two main advantages of using PowerGUI:
<br />
<ol>
<li>Dubugging of powershell script</li>
<li>Intellisense support</li>
</ol>
<div>
So, let's start setting up PowerGUI to use with sharepoint 2010:</div>
<div>
<ol style="background-color: white;">
<li><a href="http://community-downloads.quest.com/powergui/Release/3.2/PowerGUI.3.2.0.2237.msi" style="color: #b10069; text-decoration: none;">Download</a> and install latest version of PowerGUI.</li>
<li><a href="http://www.powergui.org/entry.jspa?externalID=3022&categoryID=354" style="color: #b10069; text-decoration: none;">Download</a> PowerGUI PowerPack for sharepoint.</li>
<li>Start PowerGUI script editor and go to File > Powershell Libraries</li>
<li>Click on "Add Module" and add downloaded "PowerPack for sharepoint" library here</li>
<li>That will add another entry "Microsoft.Sharepoint.PowerShell" into the listing. Check the library to make it enable</li>
<li>Restart PowerGUI script editor and you are ready to get started.</li>
</ol>
</div>
</div>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-87971324988666375042012-05-16T23:05:00.001-07:002012-05-16T23:05:55.624-07:00Best Practice: Maintaining scripts in your sharepoint project<br />
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<strong>Introduction</strong></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Branding is the most important part of any sharepoint project. If you are planning to deliver branding in your release, you have to make sure your developer team is proactive to deliver quality branding from early stage of the project. In most of the branding project, jQuery and javascript becomes must-have part. Here we will discuss practices that can be followed to ensure quality deliverables.</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<strong>Practice</strong></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<ol>
<li><strong>Manage script files</strong><br />From the very starting stage of your project, split your all javascript code in three files.</li>
<ol>
<li>jQuery.min.js - This will contain jQuery reference and should be reference first in order.</li>
<li>jQuery.plugins.js - This should contain all custom plugins we used in it.</li>
<li>ProjectName.js - This hsould contain all your custom code written to get your project pages work properly</li>
</ol>
<li><strong>Choosing plugins for your project</strong></li>
<ol>
<li>Download plugin bundle to your local computer</li>
<li>Generally plugin will contain sample html files, jQuery and plugin script files.</li>
<li>First thing to check is, jQuery version you are using in your project and the one which is used in plugin</li>
<li>If they are different, replace their jQuery.min.js with the one we are using</li>
<li>Properly test the sample provided in plugin in all browsers you are planning to support</li>
<li>Once browser and version compability matches paste plugin's min.js at end of jQuery.plugins.js file.</li>
<li>Implement plugin specific mark up wherever applicable</li>
<li>Always use projectName.js to initialize plugin.</li>
<li>Repeat above process when you choose to add any jQuery plugin</li>
</ol>
<li><strong>Resolving CONFLICTS!</strong><br />Another challenging part is jQuery ready not working or custom plugin you are using is disturbing your site's css. Here are thoughts on the same</li>
<ol>
<li>Aways use _spBodyOnLoadFunctionNames.Push("yourFunctionName") to init your scripts in page load.</li>
<li>Always use only necessary css from what plugin css has proviced and prefix class or ID in css as application. For example if a generic class .clear is used and you are calling plugin using $('#news') you should replace that with #news .clear. Do this for all css you include for the class</li>
</ol>
</ol>
</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<br /></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
<strong>Final thoughts</strong></div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
Here I pointed out some of the best practices. Like this post? You like to add/correct something? please provide your feedback on the same.</div>
<br class="Apple-interchange-newline" />Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-82593438526500457862012-05-16T23:01:00.000-07:002012-05-17T02:39:10.670-07:00SP.UI.ModalDialog.showModalDialog not working in chrome<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">In some version of browser, using will not work due to some reason. I found an alternate method to solve this problem, here is the javascript code:</span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>var dialogSP = null;
if (SP.UI.ModalDialog.showModalDialog) {
dialogSP = SP.UI.ModalDialog.showModalDialog(options);
} else {
dialogSP = SP.UI.ModalDialog.commonModalDialogOpen(countryUrl, options, null, {});
}
</code></pre>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-23416934795326976052012-05-16T22:58:00.000-07:002012-05-17T02:41:04.186-07:00jQuery.find not working in IE7 for xml data<br />
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
As part of troubleshooting a shareoint functionality, we found that jQuery.find not working.</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
We were using jQuery.ajax to call a sharepoint web service and in success function, finding an element in response xml to render it on div.</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
We fixed this and there are couple of options to fix this that we found from stackoverflow.</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
1. add dataType: 'xml' in jQuery.ajax and that will fix it.</div>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
2. in response, check for browser is IE7 and variable that is having data is blank, do it with another method, here is javascript code:</div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code>if ($.browser.msie && liHtml == "") {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(response);
liHtml = $("XmlTagNameToFind",xml).text();
}
</code></pre>
<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
I hope this will he you as well.</div>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-47736103505591061232012-05-16T22:56:00.000-07:002012-05-17T02:45:39.701-07:00Creating web application from existing content database<div style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px; margin-bottom: 10px;">
There are situations where you want to propagate one SharePoint web application to some other farm/machine. I feel the fastest way is to take content database backup and restore it in your destination farm. I have done so in last couple of weeks and I have leaned how to quickly do that.
<br />
Here are quick notes from my experience:
<br />
<b>Pre-requisites:</b><br />
I was provided with content database backup and source code. That makes be able to restore site and generate wsps from source code.<br />
<b>Creating content database from backup:</b><br />
Go to your database server and do following:<br />
<ul>
<li>Create a blank database that will be used as content database </li>
<li>Restore a database using content database back up from source farm.</li>
</ul>
<b>Creating a web application:</b><br />
<ul>
<li>Go to sharepoint central administration and create a new web application</li>
<li>While creating a new web application, use existing content database in database section</li>
<li>Sometimes if your database is too large, web application creation takes too long and times out. Don't worry at all. web application is still created successfully. It happened to me 4 times out of 5. </li>
</ul>
<b>Validating the web application:</b><br />
<ul>
<li>Go to sharepoint central administration, click on application management. In "Databases" section you will find "Manage content databases"</li>
<li>Choose your application and it will show database status and number of site collections. If you are not sure how many site collections are there in backup, anything greater than 0 is good news.</li>
</ul>
<b>Configure web application to work properly:</b><br />
we are almost done now. Do following:<br />
<ul>
<li>Go to sharepoint central administration</li>
<li>Click on "Application Management"</li>
<li>In "Site Collections" section click on "Change site collection administrators"</li>
<li>choose your web application set proper data in site admins.</li>
</ul>
<div>
<b>Additional optional steps:</b><br />
After performing all the above steps, it is still possible that you are not able to access your web application.<br />
<ul>
<li>Last thing to do is to install and deploy wsp by using stsadm or your favorite method. </li>
</ul>
<b>Conclusion:</b><br />
It is always challenging to move applications from one farm to another. Specially when they are depending upon other service applications. In spent last two weeks to learn how to properly do that. I hope this will help you at some point during your sharepoint development.</div>
</div>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-66773353503626874502012-05-16T22:54:00.000-07:002012-05-16T22:54:20.855-07:00stsadmin -o deploysolution shows access denied error for some files<br />
<h4 style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Problem</h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">After firing deploysolution, looking at system settings > farm solutions and the error looks something like "Can not overrite xxxx file, access is denied".</span><h4 style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Cause</h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">specified file in your error is read only in your web application directory. Most of the time this happens when you are using some source control system that is making the file read only when it is checked in. </span><h4 style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Solution</h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">Go to properties of the file and uncheck read only. If you are running a farm and you got multiple application servers, you need to repeate this for each application server.</span><h4 style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Conclusion</h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">80% of the developers uses command line to deploy their wsp as it is the convinient way to add or upgraded the solution.</span><h4 style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
Finally...</h4>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">Got the same error? Don't worry try above solution. Didn't worked? Let me know which one worked for you?</span>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0tag:blogger.com,1999:blog-4372976020509663155.post-28090090789985846932012-05-14T09:13:00.000-07:002012-05-14T09:24:21.382-07:00using HttpContext.GetGlobalResourceObject in webpart development<br />
<div class="ExternalClass3EEAEA4EE4A643EDA22C7DDD500A8F44" style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;">
I found interesting issue during working with global resource files this week.<br />
<div>
<br /></div>
<div>
<b>Problem:</b></div>
<div>
Event if we are using <span class="ms-rteForeColor-8" style="color: blue;">HttpContext.GetGlobalResourceObject</span>, web part was rendering data in English even if site language is other than English!</div>
<div>
<br /></div>
<div>
If we switch to edit mode, it was working sometime, but most of the time it was showing English text.</div>
<div>
<br /></div>
<div>
<b>Root cause:</b></div>
<div>
We tried creating a new application page and placed a webpart there, it was strange that it was working properly in the application page.</div>
<div>
<br /></div>
<div>
We finally found that at the time of reading resources through <span class="ms-rteForeColor-8" style="color: blue;">HttpContext.GetGlobalResourceObject</span> web part was not aware of the current UICulture</div>
<div>
<br /></div>
<div>
<b>Solution:</b></div>
<div>
<b>Before:</b></div>
<div class="csharpcode" style="color: black; font-size: small;">
<pre class="alt" style="background-color: #f4f4f4; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; width: 756px;"><span class="lnum" style="color: #606060;"> 1: </span><span class="kwrd" style="color: blue;">var</span> strLinkText = HttpContext.GetGlobalResourceObject(<span class="str" style="color: #a31515;">"file"</span>, <span class="str" style="color: #a31515;">"key"</span>);</pre>
</div>
<div>
<b>After:</b></div>
<div class="csharpcode" style="color: black; font-size: small;">
<pre class="alt" style="background-color: #f4f4f4; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; width: 756px;"><span class="lnum" style="color: #606060;"> 1: </span><span class="kwrd" style="color: blue;">var</span> strLinkText = HttpContext.GetGlobalResourceObject(<span class="str" style="color: #a31515;">"file"</span>, <span class="str" style="color: #a31515;">"key"</span>,SPContext.Current.Web.UICulture);</pre>
</div>
<div>
<b><br /></b></div>
<div>
<strong>Conclusion</strong></div>
<div>
</div>
<div>
Finally after passing third argument from <span class="ms-rteForeColor-8" style="color: blue;">SPContext.Current.Web.UICulture<span class="ms-rteThemeForeColor-2-0" style="color: black;"> </span><span class="ms-rteThemeForeColor-2-0" style="color: black;">it worked properly</span></span><span class="ms-rteThemeForeColor-2-0" style="color: black;"></span></div>
</div>
<span style="background-color: white; color: #676767; font-family: Verdana, sans-serif; font-size: 11px;"></span>Prashant Lakhlanihttp://www.blogger.com/profile/16758796316387065127noreply@blogger.com0