<?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-4420197003505233862</id><updated>2012-02-16T19:48:08.601-05:00</updated><category term='Visual Studio'/><category term='DVWP'/><category term='Sharepoint 2007'/><category term='Sandboxed Solutions'/><category term='Custom Edit  Forms'/><category term='DataFormWebPart'/><category term='Web Services'/><category term='KPI'/><category term='PerformancePoint'/><category term='Sharepoint Upgrade'/><category term='WSP'/><category term='Content Query Web Part'/><category term='Reporting Services'/><category term='Administration'/><category term='Web Development'/><category term='Custom Fields'/><category term='XsltListViewWebPart'/><category term='Chart Controls'/><category term='DataViewWebPart'/><category term='Sharepoint'/><category term='Sharepoint 2010'/><category term='SSRS'/><category term='MCTS'/><category term='MOSS'/><category term='Server 2008'/><category term='Dashboard Designer'/><title type='text'>The Notebook of Val Kirshin</title><subtitle type='html'>Answers I do not want to forget</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>val</name><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>95</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-1437060091524711307</id><published>2012-01-18T23:25:00.001-05:00</published><updated>2012-01-18T23:30:39.839-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>SharePoint InputFormTextBox without toolbar</title><content type='html'>How to render InputFormTextBox control without its toolbar? I do not see an obvious option in the InputFormTextBox class, but the script that actually renders the control has a parameter controlling whether the toolbar is generated. But InputFormTextBox simply does not specify that parameter. In fact, the RTE_ConvertTextAreaToRichEdit javascript function responsible for rendering the control in the browser has a bunch of parameters not used by the InputFormTextBox. To disable the toolbar, we need to subclass the control and pass "false" as the last parameter.&lt;br /&gt;&lt;pre&gt;public class MyInputFormTextBox : InputFormTextBox&lt;br /&gt;{&lt;br /&gt;    protected static Regex _regex = &lt;br /&gt;        new Regex("(.*RTE_ConvertTextAreaToRichEdit\\([^\\)]*)(\\);.*)",&lt;br /&gt;            RegexOptions.Singleline);&lt;br /&gt;&lt;br /&gt;    protected override void Render(HtmlTextWriter output)&lt;br /&gt;    {&lt;br /&gt;        StringBuilder sb = new StringBuilder();&lt;br /&gt;        using (StringWriter swriter = new StringWriter(sb))&lt;br /&gt;        using (HtmlTextWriter writer = new HtmlTextWriter(swriter))&lt;br /&gt;        {&lt;br /&gt;            base.Render(writer);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        Match m = _regex.Match(sb.ToString());&lt;br /&gt;        if (!m.Success) &lt;br /&gt;            output.Write(sb.ToString()); //something went wrong somewhere&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            //this outputs HTML elements and javascript call &lt;br /&gt;            //to RTE_ConvertTextAreaToRichEdit(&lt;parameters&gt;&lt;br /&gt;            //without the closing brace&lt;br /&gt;            output.Write(m.Groups[1].Value);&lt;br /&gt;            //add additional parameters to the RTE_ConvertTextAreaToRichEdit call&lt;br /&gt;            //the last &amp;quot;false&amp;quot; is what turns off the toolbar&lt;br /&gt;            output.Write(",null,null,null,null,null,null,false");&lt;br /&gt;            //output the closing brace of the function call and the rest of HTML&lt;br /&gt;            output.Write(m.Groups[2].Value);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1437060091524711307?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1437060091524711307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2012/01/sharepoint-inputformtextbox-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1437060091524711307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1437060091524711307'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2012/01/sharepoint-inputformtextbox-without.html' title='SharePoint InputFormTextBox without toolbar'/><author><name>val</name><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-4420197003505233862.post-8710782665504133395</id><published>2011-11-15T11:05:00.001-05:00</published><updated>2012-02-10T10:49:14.646-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>stsadm -o restore error with version '4.0.145.0'</title><content type='html'>Just got this error from stsadm -o restore:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.0.145.0' or later.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;4.0.145.0? What version is that? Anyway, turned out that after applying a cumulative update, the Configuration Wizard was not run on the farm where the backup was created. So I had to run the Configuration Wizard on the SOURCE farm first, then create the backup again, and then restore it on the target farm.&lt;br /&gt;&lt;br /&gt;My point here is: Configuration Wizard must be run and finish successfully in order to complete the update installation. It is a required step, see &lt;a href="http://technet.microsoft.com/en-us/library/ff806338.aspx"&gt;here&lt;/a&gt;, for example&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8710782665504133395?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8710782665504133395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/11/stsadm-o-restore-error-with-version.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8710782665504133395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8710782665504133395'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/11/stsadm-o-restore-error-with-version.html' title='stsadm -o restore error with version &apos;4.0.145.0&apos;'/><author><name>val</name><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-4420197003505233862.post-3551536417135094412</id><published>2011-10-31T18:09:00.000-04:00</published><updated>2011-10-31T18:09:31.688-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>WebPart.LoadViewState() is not called</title><content type='html'>Just spent a few minutes being puzzled over this. The point is, LoadViewState is not called if the view state object is null. So check that SaveViewState actually saves something.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3551536417135094412?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3551536417135094412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/10/webpartloadviewstate-is-not-called.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3551536417135094412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3551536417135094412'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/10/webpartloadviewstate-is-not-called.html' title='WebPart.LoadViewState() is not called'/><author><name>val</name><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-4420197003505233862.post-2194445391206097720</id><published>2011-10-17T10:33:00.000-04:00</published><updated>2011-10-17T10:33:47.496-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>SPUtility.SendEmail is synchronous</title><content type='html'>Per &lt;a href="http://www.johnhaigh.com/send-email-in-sharepointwss-30-and-moss-2007-web-part.aspx"&gt;this post&lt;/a&gt; SPUtility.SendEmail method is synchronous, which means it is not a good idea to use it in a web part's event handler. The alternatives are:&lt;br /&gt;&lt;ul&gt; &lt;li&gt;Add an item to a custom list and send email from ItemAdded event receiver which is asynchronous&lt;/li&gt; &lt;li&gt;Add an item to a custom list and send email from a workflow&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2194445391206097720?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2194445391206097720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/10/sputilitysendemail-is-synchronous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2194445391206097720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2194445391206097720'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/10/sputilitysendemail-is-synchronous.html' title='SPUtility.SendEmail is synchronous'/><author><name>val</name><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-4420197003505233862.post-1969909845143529795</id><published>2011-10-01T17:31:00.001-04:00</published><updated>2011-10-01T17:32:05.016-04:00</updated><title type='text'>InvalidOperationException: Collection was modified; enumeration operation may not execute while iterating through SPWeb.Lists</title><content type='html'>Just ran into this exception with a simple piece of code that makes sure my event receivers are only attached to the lists I want:&lt;br /&gt;&lt;pre&gt;foreach (SPList l in web.Lists)&lt;br /&gt;{&lt;br /&gt;    RemoveEventReceivers(l); //loops through all lists' receivers and&lt;br /&gt;                             //removes ones implemented by my class&lt;br /&gt;    if (&amp;lt;some condition&amp;gt;)&lt;br /&gt;        AttachReceivers(l);  //attaches my receivers to the list&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;What gives? Apparently changing event receivers counts as lists collection update, so the code above had to be rewritten as &lt;br /&gt;&lt;pre&gt;List&amp;lt;SPList&amp;gt; coll = new List&amp;lt;SPList&amp;gt;(web.Lists.Count);&lt;br /&gt;foreach (SPList l in web.Lists) coll.Add(l);&lt;br /&gt;foreach (SPList l in coll)&lt;br /&gt;{&lt;br /&gt;    RemoveEventReceivers(l);&lt;br /&gt;    if (&amp;lt;some condition&amp;gt;)&lt;br /&gt;        AttachReceivers(l);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Win 7, SP 2010&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1969909845143529795?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1969909845143529795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/10/invalidoperationexception-collection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1969909845143529795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1969909845143529795'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/10/invalidoperationexception-collection.html' title='InvalidOperationException: Collection was modified; enumeration operation may not execute while iterating through SPWeb.Lists'/><author><name>val</name><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-4420197003505233862.post-7375012168462375107</id><published>2011-09-26T16:23:00.001-04:00</published><updated>2011-09-26T16:25:19.022-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>SharePoint Save Conflict exception when saving attachments</title><content type='html'>I'm writing a custom page that updates both list item's fields and attachments. I.e. it adds and/or removes item's attachments in addition to changing field values. Straightforward approach, i.e. make all modifications and call update results in SPException:&lt;pre&gt;Save Conflict.&lt;br /&gt;Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.&lt;/pre&gt;So I'm running a simple test. In a console application, not even in any unit testing framework:&lt;a name='more'&gt;&lt;/a&gt;&lt;pre&gt;//setup&lt;br /&gt;while (list.Items.Count &gt; 0) list.Items.Delete(0);&lt;br /&gt;SPListItem item = list.Items.Add();&lt;br /&gt;item["Title"] = "Test item";&lt;br /&gt;item.Update();&lt;br /&gt;&lt;br /&gt;item = list.Items[0];&lt;br /&gt;item.Attachments.Add("buff.bin", buff);&lt;br /&gt;item.Update();&lt;br /&gt;&lt;br /&gt;//end setup&lt;br /&gt;&lt;br /&gt;//test code here, see below in the post&lt;br /&gt;&lt;br /&gt;//check results&lt;br /&gt;item=list.Items[0];&lt;br /&gt;if (item["Title"].ToString() != "Changed title") &lt;br /&gt;    Console.WriteLine("Title was not updated");&lt;br /&gt;if (item.Attachments.Count != 1) Console.WriteLine(&lt;br /&gt;    String.Format("Attachments count is wrong, expected 1, got {0}",&lt;br /&gt;         item.Attachments.Count));&lt;br /&gt;if (item.Attachments.Count &gt; 0)&lt;br /&gt;{&lt;br /&gt;    if (item.Attachments[0] != "changed.bin")&lt;br /&gt;        Console.WriteLine("Attachment name is wrong, expected \"changed.bin\" got \""&lt;br /&gt;          + item.Attachments[0] + "\"");&lt;br /&gt;}&lt;br /&gt;//end results&lt;/pre&gt;&lt;h3&gt;Straightforward test&lt;/h3&gt;&lt;pre&gt;//test&lt;br /&gt;item = list.Items[0];&lt;br /&gt;item["Title"] = "Changed title";&lt;br /&gt;&lt;br /&gt;SPFolder folder = web.Folders["Lists"].SubFolders[list.Title]&lt;br /&gt;           .SubFolders["Attachments"].SubFolders[item.ID.ToString()];&lt;br /&gt;SPFile file=folder.Files["buff.bin"];&lt;br /&gt;file.Delete();&lt;br /&gt;&lt;br /&gt;item.Attachments.Add("changed.bin", buff);&lt;br /&gt;item.Update(); &lt;strong&gt;&lt;u&gt;&amp;lt;-- exception here&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;//end test&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;This works in console application&lt;/h3&gt;&lt;pre&gt;//test&lt;br /&gt;item = list.Items[0];&lt;br /&gt;item["Title"] = "Changed title";&lt;br /&gt;&lt;strong&gt;&lt;u&gt;item.Update();&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SPFolder folder = web.Folders["Lists"].SubFolders[list.Title]&lt;br /&gt;           .SubFolders["Attachments"].SubFolders[item.ID.ToString()];&lt;br /&gt;SPFile file=folder.Files["buff.bin"];&lt;br /&gt;file.Delete();&lt;br /&gt;&lt;br /&gt;item.Attachments.Add("changed.bin", buff);&lt;br /&gt;item.Update(); &amp;lt;-- &lt;strong&gt;&lt;u&gt;still exception here when&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;                       &lt;strong&gt;&lt;u&gt;executed from a web page&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;//end test&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;This works on a web page&lt;/h3&gt;&lt;pre&gt;//test&lt;br /&gt;item = list.Items[0];&lt;br /&gt;item["Title"] = "Changed title";&lt;br /&gt;item.Update();&lt;br /&gt;&lt;br /&gt;SPFolder folder = web.Folders["Lists"].SubFolders[list.Title].SubFolders["Attachments"]&lt;br /&gt;      .SubFolders[item.ID.ToString()];&lt;br /&gt;SPFile file=folder.Files["buff.bin"];&lt;br /&gt;file.Delete();&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;item = item.ParentList.GetItemByUniqueId(item.UniqueId);&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;item.Attachments.Add("changed.bin", buff);&lt;br /&gt;item.Update();&lt;br /&gt;//end test&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7375012168462375107?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7375012168462375107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/sharepoint-save-conflict-exception-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7375012168462375107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7375012168462375107'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/sharepoint-save-conflict-exception-when.html' title='SharePoint Save Conflict exception when saving attachments'/><author><name>val</name><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-4420197003505233862.post-5903059730556217046</id><published>2011-09-21T16:50:00.005-04:00</published><updated>2011-09-21T17:02:27.819-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Max number of &lt;Value&gt; elements in the &lt;In&gt; element of a CAML Query</title><content type='html'>I cannot find anything about how many &amp;lt;Value&amp;gt; elements are allowed under &amp;lt;Values&amp;gt; collection in &amp;lt;In&amp;gt; element of a CAML query. So I ran this test in a console application:&lt;pre&gt;using (SPSite site = new SPSite("http://myserver/sites/mysite/"))&lt;br /&gt;using (SPWeb web = site.OpenWeb())&lt;br /&gt;{&lt;br /&gt;    SPList list = web.Lists["MyList"];&lt;br /&gt;    SPQuery query = new SPQuery();&lt;br /&gt;    StringBuilder sb = new StringBuilder();&lt;br /&gt;    sb.Append("&amp;lt;Where&amp;gt;&amp;lt;In&amp;gt;&amp;lt;FieldRef Name=\"ID\"/&amp;gt;&amp;lt;Values&amp;gt;");&lt;br /&gt;    for (int i = 0; i &lt; 500; i++)&lt;br /&gt;    {&lt;br /&gt;        sb.AppendFormat("&amp;lt;Value Type=\"Text\"&amp;gt;{0}&amp;lt;/Value&amp;gt;", i);&lt;br /&gt;    }&lt;br /&gt;    sb.Append("&amp;lt;/Values&amp;gt;&amp;lt;/In&amp;gt;&amp;lt;/Where&amp;gt;");&lt;br /&gt;    query.Query = sb.ToString();&lt;br /&gt;&lt;br /&gt;    SPListItemCollection items = list.GetItems(query);&lt;br /&gt;&lt;br /&gt;    foreach (SPListItem item in items)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(item["Title"].ToString());&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;500 worked, anything above that produced E_INVALIDARG (0x80070057) exception&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5903059730556217046?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5903059730556217046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/max-number-of-elements-in-element-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5903059730556217046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5903059730556217046'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/max-number-of-elements-in-element-of.html' title='Max number of &amp;lt;Value&amp;gt; elements in the &amp;lt;In&amp;gt; element of a CAML Query'/><author><name>val</name><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-4420197003505233862.post-2470579559553637719</id><published>2011-09-21T15:57:00.003-04:00</published><updated>2011-10-01T18:21:36.950-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>FileNotFoundException while trying to access SharePoint site from a console application</title><content type='html'>As usual, I created a console application project to run a quick test on my development Win 2008 VM. And it blew up on the very first line, which was&lt;pre&gt;using (SPSite site = new SPSite("http://myserver/sites/mysite"))&lt;/pre&gt;with FileNotFoundException:&lt;pre&gt;System.IO.FileNotFoundException was unhandled&lt;br /&gt;Message=The Web application at http://myserver/sites/mysite could not be found.&lt;br /&gt;Verify that you have typed the URL correctly. If the URL should be serving &lt;br /&gt;existing content, the system administrator may need to add a new &lt;br /&gt;request URL mapping to the intended application.&lt;/pre&gt;That left me puzzled for a while. Eventually I noticed that the build target was set to x86! Changed that to x64 and it now works.&lt;br /&gt;&lt;br /&gt;Then I had another instance of the same issue while creating unit tests for a SharePoint project using Visual Studio Testing Tools. By default the test host runs in 32 bit mode even on 64 bit OS and it &lt;a href="http://msdn.microsoft.com/en-us/library/ee782531.aspx"&gt;must be configured&lt;/a&gt; to run in 64 bit mode to work with SharePoint.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2470579559553637719?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2470579559553637719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/filenotfoundexception-while-trying-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2470579559553637719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2470579559553637719'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/filenotfoundexception-while-trying-to.html' title='FileNotFoundException while trying to access SharePoint site from a console application'/><author><name>val</name><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-4420197003505233862.post-8141224820822955595</id><published>2011-09-13T12:05:00.002-04:00</published><updated>2011-09-13T13:18:03.390-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sandboxed Solutions'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Restictions of Sandboxed Solutions</title><content type='html'>Of course there's a great MSDN article &lt;a href="http://msdn.microsoft.com/en-us/library/gg615454.aspx"&gt;Restrictions on Sandboxed Solutions in SharePoint 2010&lt;/a&gt;. But what it all really means for me as a hard-core ASP.Net developer working on SharePoint projects?&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;Sandboxed Web Parts are rendered in a separate process&lt;/dt&gt;&lt;dd&gt;- In fact, EACH sandboxed web part on a page is rendered in a separate context&lt;/dd&gt; &lt;dd&gt;- Therefore sandboxed web parts cannot share data and cannot really modify objects such as Response, Cache, Session, Page.Items&lt;/dd&gt; &lt;dd&gt;- Which means that Response.Redirect() does not work. Now that is a showstopper for me, because it means that all application logic processing got to be pushed to client because I can only redirect from javascript now.&lt;/dd&gt; &lt;dd&gt;- ASP.Net validation controls' client-side validation will not work because it depends on javascript which is registered using ScriptManager the real instance of which is not accessible from the sandbox&lt;/dd&gt; &lt;dd&gt;&amp;nbsp;&lt;/dd&gt;&lt;dt&gt;Microsoft.SharePoint.Administration namespace is not availabe&lt;/dt&gt;&lt;dd&gt;Which means SPDiagnosticsService is not available, which means we can't write to ULS logs. Unless we use a full-trust proxy (&lt;a href="http://sandbox.codeplex.com/documentation"&gt;SharePoint Logger&lt;/a&gt;) which is, of course, a farm-level solution itself.&lt;/dd&gt; &lt;dd&gt;&amp;nbsp;&lt;/dd&gt;&lt;dt&gt;Microsoft.SharePoint.WebControls is not available&lt;/dt&gt;&lt;dd&gt;So no PeoplePicker, no DateTimeControl. What are we going to replace them with, a jquery plugin?&lt;/dd&gt;  &lt;dd&gt;&amp;nbsp;&lt;/dd&gt;&lt;dt&gt;SPEventReceiverDefinitionCollection.Add() is not available. Sigh. So the only way to add list event receivers is during feature activation using Elements.xml. &lt;/dt&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8141224820822955595?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8141224820822955595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/restictions-of-sandboxed-solutions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8141224820822955595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8141224820822955595'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/restictions-of-sandboxed-solutions.html' title='Restictions of Sandboxed Solutions'/><author><name>val</name><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-4420197003505233862.post-3038521816352540236</id><published>2011-09-12T14:27:00.001-04:00</published><updated>2011-09-12T14:27:42.503-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>On importance of NAME attribute for HTML controls</title><content type='html'>I am now doing quite a bit of development for SharePoint using javascript. In particular, I create input controls dynamically quite a lot. The important thing when doing that is to not forget to specify the &lt;i&gt;name&lt;/i&gt; attribute. Somehow, because I'm so used to &lt;i&gt;getElementById()&lt;/i&gt;, I always specify the &lt;i&gt;id&lt;/i&gt; attribute and often forget the &lt;i&gt;name&lt;/i&gt; attribute. However, per &lt;a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13"&gt;HTML spec&lt;/a&gt; a control without a &lt;i&gt;name&lt;/i&gt; will not get posted back on form submission. Which may result in some more grey hair.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3038521816352540236?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3038521816352540236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/on-importance-on-name-attribute-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3038521816352540236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3038521816352540236'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/on-importance-on-name-attribute-for.html' title='On importance of NAME attribute for HTML controls'/><author><name>val</name><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-4420197003505233862.post-6160999854854575777</id><published>2011-09-12T14:16:00.000-04:00</published><updated>2011-09-12T14:16:26.921-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Exception from HRESULT 0x8007000D when adding attachments</title><content type='html'>I recently got the exception&lt;br /&gt;&lt;pre&gt;The data is invalid. (Exception from HRESULT 0x8007000D)&lt;/pre&gt;while adding a new list item with an attachment. Turns out SharePoint does not accept zero-length attachments.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-6160999854854575777?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/6160999854854575777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/exception-from-hresult-0x8007000d-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6160999854854575777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6160999854854575777'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/exception-from-hresult-0x8007000d-when.html' title='Exception from HRESULT 0x8007000D when adding attachments'/><author><name>val</name><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-4420197003505233862.post-6825233331424936020</id><published>2011-09-09T13:18:00.003-04:00</published><updated>2011-09-09T13:24:10.820-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Disable the Attach Security Warning when attaching debugger to w3wp.exe in Visual Studio 2010</title><content type='html'>The way to debug SharePoint 2010 solutions is to attach the debugger to the w3wp.exe process (or timer process, user code host process) using Debugger/Attach to Process in Visual Studio. Unfortunately under Windows 2008 (and also Vista and Windows 7)  VS displays a warning message confirming that you want to attach to the process you just asked VS to attach to. &lt;br /&gt;&lt;br /&gt;To disable the warning in VS 2010 first close all instances of VS, then set&lt;br /&gt;&lt;pre&gt;HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger\DisableAttachSecurityWarning&lt;/pre&gt;to 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-6825233331424936020?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/6825233331424936020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/disable-attach-security-warning-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6825233331424936020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6825233331424936020'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/disable-attach-security-warning-when.html' title='Disable the Attach Security Warning when attaching debugger to w3wp.exe in Visual Studio 2010'/><author><name>val</name><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-4420197003505233862.post-2612607491117964016</id><published>2011-09-01T17:22:00.002-04:00</published><updated>2011-11-17T10:41:36.401-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>How to deploy a custom list template (.stp) using a feature</title><content type='html'>&lt;pre&gt;&amp;lt;Module Name=&amp;quot;ListTemplates&amp;quot; Url=&amp;quot;_catalogs/lt&amp;quot; List=&amp;quot;114&amp;quot; RootWebOnly=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;File Path=&amp;quot;ListTemplates\MyTemplate.stp&amp;quot; Url=&amp;quot;MyTemplate.stp&amp;quot; &lt;b&gt;Type=&amp;quot;GhostableInLibrary&amp;quot;&lt;/b&gt; &lt;br /&gt;    IgnoreIfAlreadyExists=&amp;quot;FALSE&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;Property Name=&amp;quot;LanguageDisplay&amp;quot; Value=&amp;quot;English&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;Property Name=&amp;quot;Product Version&amp;quot; Value=&amp;quot;4&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/File&amp;gt;&lt;br /&gt;&amp;lt;/Module&amp;gt;&lt;/pre&gt;&lt;br /&gt;To create a list based on the template:&lt;br /&gt;&lt;pre&gt;public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;{&lt;br /&gt;    //assuming it is a web-scoped feature&lt;br /&gt;    SPWeb web = properties.Feature.Parent as SPWeb; &lt;br /&gt;    SPListTemplateCollection templates = web.Site.GetCustomListTemplates(web);&lt;br /&gt;&lt;br /&gt;    //use the name of the template, NOT the file name of the template file&lt;br /&gt;    SPListTemplate template = templates["MyTemplate"]; &lt;br /&gt;    web.Lists.Add("MyList", String.Empty, template);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2612607491117964016?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2612607491117964016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/09/how-to-deploy-custom-list-template-stp.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2612607491117964016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2612607491117964016'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/09/how-to-deploy-custom-list-template-stp.html' title='How to deploy a custom list template (.stp) using a feature'/><author><name>val</name><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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-5808955743735419456</id><published>2011-07-01T11:21:00.000-04:00</published><updated>2011-07-01T11:21:53.796-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Load symbols for SharePoint 2010 remote debugging</title><content type='html'>Make sure your .pdb files are in the same location on the remote and local servers. &lt;br /&gt;E.g. :&lt;br /&gt;- Visual Studio is on ServerA&lt;br /&gt;- the actual SharePoint server with msvsmon running is ServerB&lt;br /&gt;- Attach the debugger to the remote w3wp process as usual&lt;br /&gt;- open Debug/Modules window&lt;br /&gt;- find your .dll &lt;br /&gt;- right-click, Load Symbols From&lt;br /&gt;- Here it will browse the ServerA file system. So browse to the location with your .pdb file, say c:\dir\my.pdb&lt;br /&gt;- Now, for symbols to get loaded, my.pdb must be copied to the same location on ServerB, i.e. c:\dir\my.pdb but on ServerB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5808955743735419456?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5808955743735419456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/07/load-symbols-for-sharepoint-2010-remote.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5808955743735419456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5808955743735419456'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/07/load-symbols-for-sharepoint-2010-remote.html' title='Load symbols for SharePoint 2010 remote debugging'/><author><name>val</name><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-4420197003505233862.post-3562865377321987932</id><published>2011-06-06T23:11:00.001-04:00</published><updated>2011-06-06T23:12:26.101-04:00</updated><title type='text'>The best tool for web site prototyping</title><content type='html'>What is the BEST tool for web site prototyping, wire-framing and the like? I can now tell you: it's PowerPoint 2010. Try it next time you need to make a prototype page design, you won't regret it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3562865377321987932?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3562865377321987932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/06/best-tool-for-web-site-prototyping.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3562865377321987932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3562865377321987932'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/06/best-tool-for-web-site-prototyping.html' title='The best tool for web site prototyping'/><author><name>val</name><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-4420197003505233862.post-7143036088976663081</id><published>2011-06-05T03:39:00.001-04:00</published><updated>2011-06-11T14:21:36.493-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Access Denied errors in Central Administration</title><content type='html'>Yet another weirdness of running Sharepoint Server 2010 on Windows 7: unless Internet Explorer is run as Administrator, several actions in Central Administration will result in Access Denied errors, notably attempting to deploy solutions which add assemblies to GAC or modifying Farm Administrators group. Latter case actually logs an error complaining about lack of administrative privileges. Basically, just run IE as Administrator.&lt;br /&gt;&lt;br /&gt;Note: It is also true for Server 2008, but not always and I do not yet know how it works exactly. Point is, if links suchs as Manage Services on Server are missing from Central Administration, or if you receive Access Denied in Central Administration while being Farm Admininstrator and Windows Administrator, make sure you run IE as Administrator as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7143036088976663081?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7143036088976663081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/06/access-denied-when-deploying-solution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7143036088976663081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7143036088976663081'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/06/access-denied-when-deploying-solution.html' title='Access Denied errors in Central Administration'/><author><name>val</name><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-4420197003505233862.post-807522098748409971</id><published>2011-06-02T14:45:00.001-04:00</published><updated>2011-06-12T20:20:56.915-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>SharePoint 2010: How to make custom user profile properties searchable</title><content type='html'>&lt;a href="http://blogs.technet.com/b/meamcs/archive/2010/12/23/sharepoint-2010-people-search-using-metadata.aspx"&gt;Here&lt;/a&gt; and &lt;a href="http://www.sharepointsteve.com/2010/10/making-custom-user-profile-properties-searchable-in-sharepoint-2010/"&gt;here&lt;/a&gt;.&lt;br /&gt;Basically:&lt;br /&gt;- to make it searchable you got to create managed property mapping in search application. Then you'll be able to search for it using property:value syntax.&lt;br /&gt;- to add it to Search Options, you got to modify the XML of the People Search Box web part (both of them, one on people.aspx and the other on peopleresults.aspx, assuming you use Search Center)&lt;br /&gt;- to actually show the property in search results, you got to modify the XSLT and parameters of search results web part&lt;br /&gt;- now, to make your property searchable by default, i.e. by just typing a query rather than going through Search Options, you got to map it to ContentsHidden managed property&lt;br /&gt;&lt;br /&gt;Now, you've got to do a bunch of Full Crawls while you are setting things up. E.g. after creating a new User Property and before it will appear as Crawled Property. Keep an eye on Crawl Logs, I just had an issue with User Profile Property not appearing as Crawled Property because my web application did not have root site collection created.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-807522098748409971?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/807522098748409971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/06/sharepoint-2010-how-to-make-custom-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/807522098748409971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/807522098748409971'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/06/sharepoint-2010-how-to-make-custom-user.html' title='SharePoint 2010: How to make custom user profile properties searchable'/><author><name>val</name><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-4420197003505233862.post-1849757789805223480</id><published>2011-05-20T18:36:00.003-04:00</published><updated>2011-05-20T18:37:51.790-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='PerformancePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='KPI'/><category scheme='http://www.blogger.com/atom/ns#' term='Dashboard Designer'/><title type='text'>PerformancePoint scorecard using SharePoint list: columns not showing up in KPI Actual drop down</title><content type='html'>Let's say you want to create a scorecard in Performance Point based on the data in a SharePoint list. Open Dashboard Designer, configure your datasource, then on the Create tab click on Scorecard, select the datasouce and the press Add KPI:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-rRBDS_Bhvk4/TdbsYnXuRzI/AAAAAAAAATg/7aL317VfE4Q/s1600/sp+list+kpi.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="526" src="http://2.bp.blogspot.com/-rRBDS_Bhvk4/TdbsYnXuRzI/AAAAAAAAATg/7aL317VfE4Q/s640/sp+list+kpi.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Obviously not all columns are present in the Actual drop down. Which SharePoint columns make it there? It appears that:&lt;br /&gt;- Column must be include in the default view of the list&lt;br /&gt;- At least one item must have a non-empty value in the column &lt;br /&gt;- All data in the column must be convertable to number. I.e. numeric fields, text fields containing numeric data only, yes/no fields, etc. Empty values are fine, as long as at least one item has a non-empty value. &lt;br /&gt;&lt;br /&gt;Also, by default PerformancePoint datasource is configured to cache the data for 10 minutes (on datasource's Edit tab). So if you change list structure or data in SharePoint, it will be reflected in Dashboard Designer only after the cache has expired.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1849757789805223480?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1849757789805223480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/05/performancepoint-scorecard-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1849757789805223480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1849757789805223480'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/05/performancepoint-scorecard-using.html' title='PerformancePoint scorecard using SharePoint list: columns not showing up in KPI Actual drop down'/><author><name>val</name><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/-rRBDS_Bhvk4/TdbsYnXuRzI/AAAAAAAAATg/7aL317VfE4Q/s72-c/sp+list+kpi.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-1533562063477711045</id><published>2011-05-15T00:05:00.002-04:00</published><updated>2011-05-15T00:28:44.217-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Specifying users' email in Sharepoint 2010</title><content type='html'>How to deal with&amp;nbsp; "You do not have an e-mail address.&amp;nbsp; Alert has been created successfully  but you will not receive notifications until valid e-mail or mobile  address has been provided in your profile." error message.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Long story short:&lt;br /&gt;In Foundation just add the email address on the My Settings page.&lt;br /&gt;In Server either add email for each user in User Profile Service Application properties, or let them edit it themselves. But it must get copied from User Profile web application to "real", content web applications before it could be used in Alerts.&lt;br /&gt;&lt;br /&gt;To copy it from User Profile application:&lt;br /&gt;- Make sure User Profile Synchronization Service is running&lt;br /&gt;- Make sure the sync of user profiles to Active Directory is finished (Note: I need to test what's happening on a clean install)&lt;br /&gt;-  Either wait for it to run as scheduled (hourly by default) or force to  run "User Profile Service Application - User Profile to SharePoint Full  Synchronization" timer job.&lt;br /&gt;&lt;br /&gt;Long story, with illustrations:&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;1. Sharepoint 2010 Foundation: &lt;/h1&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PnLOPIgN9XE/Tc8pVHqO-UI/AAAAAAAAAS4/OttbTnjSPZg/s1600/Foundation+Version.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="332" src="http://2.bp.blogspot.com/-PnLOPIgN9XE/Tc8pVHqO-UI/AAAAAAAAAS4/OttbTnjSPZg/s640/Foundation+Version.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Obviously there is no User Profile Service:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-n5GE1SL93wE/Tc8pjLj4AKI/AAAAAAAAAS8/Dd49EDP2xys/s1600/Foundation+Service+Apps.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="309" src="http://3.bp.blogspot.com/-n5GE1SL93wE/Tc8pjLj4AKI/AAAAAAAAAS8/Dd49EDP2xys/s640/Foundation+Service+Apps.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Also, "Welcome Menu" only has link to My Settings Page:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KeuLruI1t1g/Tc8qPRHr8bI/AAAAAAAAATA/03_dyfeb3Hw/s1600/Foundation+User+Menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-KeuLruI1t1g/Tc8qPRHr8bI/AAAAAAAAATA/03_dyfeb3Hw/s1600/Foundation+User+Menu.png" /&gt;&lt;/a&gt;&lt;/div&gt;Which lets you specify email address:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-B9MdWbGi2xE/Tc8qX1auokI/AAAAAAAAATE/CkisLD9ey7M/s1600/Foundation+Edit+User+Settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="366" src="http://4.bp.blogspot.com/-B9MdWbGi2xE/Tc8qX1auokI/AAAAAAAAATE/CkisLD9ey7M/s640/Foundation+Edit+User+Settings.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;That was easy.&lt;br /&gt;&lt;h1&gt;2. Sharepoint 2010 Server &lt;/h1&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-pavOahX8Ug0/Tc8yxqHJtKI/AAAAAAAAATI/birIFxKbe5I/s1600/Server+Version.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-pavOahX8Ug0/Tc8yxqHJtKI/AAAAAAAAATI/birIFxKbe5I/s640/Server+Version.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;In Server, user properties are stored in user profile:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ms3pE3KhXPo/Tc9VE3I8dzI/AAAAAAAAATc/cgID14oejFs/s1600/Server+Welcome+Menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-ms3pE3KhXPo/Tc9VE3I8dzI/AAAAAAAAATc/cgID14oejFs/s1600/Server+Welcome+Menu.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;so here's My Settings page:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-l-LJHGUPLMs/Tc8zMJwbJzI/AAAAAAAAATM/js0YXWGfEh0/s1600/Server+User+Settings+-+WebApp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="334" src="http://4.bp.blogspot.com/-l-LJHGUPLMs/Tc8zMJwbJzI/AAAAAAAAATM/js0YXWGfEh0/s640/Server+User+Settings+-+WebApp.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And, of course, by default it does not let you edit email address. Also, the settings are in User Profile regardless of whether User Profile Synchronization is configured:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IA79950dfQg/Tc80C6WVJrI/AAAAAAAAATU/B1hLinM7hFg/s1600/Server+No+Profile+Sync.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="332" src="http://4.bp.blogspot.com/-IA79950dfQg/Tc80C6WVJrI/AAAAAAAAATU/B1hLinM7hFg/s640/Server+No+Profile+Sync.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Disassociating a web application from User Profile Service does not seem to change the My Settings page. However, Central Administration does not seem to use UPS anyway:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-u_QH80GhQs0/Tc8zVSmvyRI/AAAAAAAAATQ/9dac84E4vEM/s1600/Server+User+Settings+-+CA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="330" src="http://1.bp.blogspot.com/-u_QH80GhQs0/Tc8zVSmvyRI/AAAAAAAAATQ/9dac84E4vEM/s640/Server+User+Settings+-+CA.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Now, if you allow users to edit their email address on Central Admin/Application Management/Manage Service Applications/User Profile Service/Manage User Properties:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-qaTC7yNH1CA/Tc87Zn7tLbI/AAAAAAAAATY/uQURsX010hI/s1600/Server+Work+Email+Property.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="432" src="http://1.bp.blogspot.com/-qaTC7yNH1CA/Tc87Zn7tLbI/AAAAAAAAATY/uQURsX010hI/s640/Server+Work+Email+Property.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;Then users will be able to edit their email on their profile page. However, once they edit it, it does not immediately appear on My Settings page and attempting to set up Alerts will still result in "You do not have an e-mail address.&amp;nbsp; Alert has been created successfully but you will not receive notifications until valid e-mail or mobile address has been provided in your profile." error message. To propagate it from User Profile to each individual web application:&lt;br /&gt;- Make sure User Profile Synchronization Service is running&lt;br /&gt;- Make sure the sync of user profiles to Active Directory is finished (Note: I need to test what's happening on a clean install)&lt;br /&gt;- Either wait for it to run as scheduled (hourly by default) or force to run "User Profile Service Application - User Profile to SharePoint Full Synchronization" timer job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1533562063477711045?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1533562063477711045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/05/specifying-users-email-in-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1533562063477711045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1533562063477711045'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/05/specifying-users-email-in-sharepoint.html' title='Specifying users&apos; email in Sharepoint 2010'/><author><name>val</name><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/-PnLOPIgN9XE/Tc8pVHqO-UI/AAAAAAAAAS4/OttbTnjSPZg/s72-c/Foundation+Version.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-6497264809142787766</id><published>2011-05-10T22:42:00.002-04:00</published><updated>2011-05-10T22:43:57.109-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Content Query Web Part'/><title type='text'>How to use Content Query Web Part to display HTML contents of Announcements list</title><content type='html'>When I added a Content Query Web Part (CQWP) and configured it to display an Announcement list using "Title and Description" style, here's what I got:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-CfslVcdS3sg/Tcn2MWL9c4I/AAAAAAAAASs/aRPKy3RDoM4/s1600/CQWP_Escaped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-CfslVcdS3sg/Tcn2MWL9c4I/AAAAAAAAASs/aRPKy3RDoM4/s1600/CQWP_Escaped.png" /&gt;&lt;/a&gt;&lt;/div&gt;Since CQWP uses all too familiar approach of "apply XSLT to something", it is obvious that somewhere a disable-output-escaping="yes" attribute needs to be added. The question was: where? &lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa981241.aspx"&gt;This MSDN article&lt;/a&gt; gives an overview of how CQWP works and where its XSLT is located. But a quick look at ItemStyle.xsl shows that "Title and Description" is not there. Sharepoint Designer, however, reveals that the web part has a property ItemStyle="NoImage". &lt;br /&gt;&lt;br /&gt;Now, what we need is to append the attribute under NoImage template in ItemStyle.xsl:&lt;br /&gt;&lt;pre&gt;&amp;lt;div class="description"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of select="@Description" &lt;b&gt;disable-output-escaping="yes"&lt;/b&gt; /&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;Note that it will change appearance of &lt;b&gt;all&lt;/b&gt; CQWPs on the site that use NoImage style. So instead make a copy of NoImage template, put it into the same ItemStyle.xsl and change the name to something useful, e.g. MyNoImage. Then make the above change in the copy, then go to CQWP properties and notice that it lists the new style along with all standard ones, how cool is that:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-o9gF0Ph6k2w/Tcn2iSg5XII/AAAAAAAAASw/1A7SVmDCZFs/s1600/MyNoImage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-o9gF0Ph6k2w/Tcn2iSg5XII/AAAAAAAAASw/1A7SVmDCZFs/s1600/MyNoImage.png" /&gt;&lt;/a&gt;&lt;/div&gt;Now it will display rich text properly:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/--b8Bdw8Q61c/Tcn25g_IvjI/AAAAAAAAAS0/OOK9_yyvXbs/s1600/CQWP_NotEscaped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/--b8Bdw8Q61c/Tcn25g_IvjI/AAAAAAAAAS0/OOK9_yyvXbs/s1600/CQWP_NotEscaped.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-6497264809142787766?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/6497264809142787766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/05/how-to-use-content-query-web-part-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6497264809142787766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6497264809142787766'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/05/how-to-use-content-query-web-part-to.html' title='How to use Content Query Web Part to display HTML contents of Announcements list'/><author><name>val</name><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://3.bp.blogspot.com/-CfslVcdS3sg/Tcn2MWL9c4I/AAAAAAAAASs/aRPKy3RDoM4/s72-c/CQWP_Escaped.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-7864820585948152064</id><published>2011-04-25T21:38:00.000-04:00</published><updated>2011-04-25T21:38:42.962-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XsltListViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Customizing the "Boxed, No Labels" view style in Sharepoint 2010</title><content type='html'>The "Boxed, No Labels" is one of the predefined styles which can be applied to the XsltListViewWebpart in sharepoint Designer:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TNXBvB94-Kw/TbYRf2dxqeI/AAAAAAAAASc/ZSbm8cWHmgw/s1600/boxed_nolabel_style_selector.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-TNXBvB94-Kw/TbYRf2dxqeI/AAAAAAAAASc/ZSbm8cWHmgw/s1600/boxed_nolabel_style_selector.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;It displays items in a two column table:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-z7wk09LLM0Y/TbYSezBl2WI/AAAAAAAAASg/JOlr_kbApu8/s1600/boxed_nolabel_2cols.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-z7wk09LLM0Y/TbYSezBl2WI/AAAAAAAAASg/JOlr_kbApu8/s1600/boxed_nolabel_2cols.jpg" width="80%"/&gt;&lt;/a&gt;&lt;/div&gt;Now, there was question how to make it display 3 or 4 column table? It is definitely possible by modifying the XSLT. &lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;So open a page in Sharepoint Designer, select an existing list view or add a new one. Then on the Design tab on the ribbon under "Customize XSLT" click "Customize the Entire View". As a result, the XSLT the list view uses to render its contents will be added to the page and can be modified. If there are several list views on the page, make sure to modify the correct one while applying the following changes.&lt;br /&gt;&lt;br /&gt;1. Switch to the Code pane and do a Search-and-Replace removing all instances of the text &lt;i&gt;ddwrt:ghost="hide" &lt;/i&gt;Otherwise Sharepoint will not persist some changes to the XSLT which we are about to make. &lt;br /&gt;&lt;br /&gt;2. Search for "NewTRJumbo" string (without quotes). It should find a string like this:&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:template ddwrt:ghost="" name="NewTRJumbo"&lt;br /&gt; xmlns:ddwrt2="urn:frontpage:internal"&amp;gt; &lt;/pre&gt;&lt;br /&gt;3. A few lines below it there should be a string &lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:when test="$Position mod 2 = 0"&amp;gt;&lt;/pre&gt;The "2" there dictates the number of columns. Change it to 3 for example. It will display like this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0hTWQhjCwKw/TbYVDnmcrQI/AAAAAAAAASk/xlSF6mdq8Pc/s1600/boxed_nolabel_3cols.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-0hTWQhjCwKw/TbYVDnmcrQI/AAAAAAAAASk/xlSF6mdq8Pc/s1600/boxed_nolabel_3cols.jpg" width="80%" /&gt;&lt;/a&gt;&lt;/div&gt;Note that the third column is narrow and the header does not extend across the third column.&lt;br /&gt;&lt;br /&gt;4. To fix the column width, find the line &lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:template mode="Item"&lt;/pre&gt;A number of lines after it there should be the line&lt;br /&gt;&lt;pre&gt;&amp;lt;td valign="top" width="50%" class="ms-stylebox"&amp;gt;&lt;/pre&gt;That's the cell displaying an individual item. Change the width to about 100% divided by the number of columns you want. In my case I'll do 33%.&lt;br /&gt;&lt;br /&gt;5. To fix the header, find the line &lt;br /&gt;&lt;pre&gt;&amp;lt;tr valign="top" class="ms-viewheadertr"&amp;gt;&lt;/pre&gt;A couple lines above it there should be a line &lt;br /&gt;&lt;pre&gt;&amp;lt;td colspan="3"&amp;gt;&lt;/pre&gt;Change 3 to 99&lt;br /&gt;&lt;br /&gt;That's it, here's the finished page:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-HgPWWpF2ofA/TbYesVgcvPI/AAAAAAAAASo/e391WBDxJDE/s1600/boxed_nolabel_3cols_final.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-HgPWWpF2ofA/TbYesVgcvPI/AAAAAAAAASo/e391WBDxJDE/s1600/boxed_nolabel_3cols_final.jpg" width="80%" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7864820585948152064?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7864820585948152064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/04/customizing-boxed-no-labels-view-style.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7864820585948152064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7864820585948152064'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/04/customizing-boxed-no-labels-view-style.html' title='Customizing the &quot;Boxed, No Labels&quot; view style in Sharepoint 2010'/><author><name>val</name><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://3.bp.blogspot.com/-TNXBvB94-Kw/TbYRf2dxqeI/AAAAAAAAASc/ZSbm8cWHmgw/s72-c/boxed_nolabel_style_selector.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-4267806208627554448</id><published>2011-04-14T22:35:00.002-04:00</published><updated>2011-09-09T15:55:46.443-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Server 2008'/><title type='text'>Why VMWare is better than Hyper-V</title><content type='html'>Why VMWare is better than Hyper-V for me personally:&lt;br /&gt;- Linux support. Hyper-V can't run Ubuntu? WTF? I don't care which side is to blame, running Linux is somewhere in the top five reasons I need virtualization in the first place&lt;br /&gt;- USB devices not propagated to VMs. So in Hyper-V I cannot create a VM with an old OS solely for the purpose of using an old USB scanner that does not have 64bit drivers. I can understand why MS would not care about that, but I do.&lt;br /&gt;&lt;br /&gt;Anyway, Oracle's VirtualBox is way better than both.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4267806208627554448?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4267806208627554448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/04/why-vmware-is-better-than-hyper-v.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4267806208627554448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4267806208627554448'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/04/why-vmware-is-better-than-hyper-v.html' title='Why VMWare is better than Hyper-V'/><author><name>val</name><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-4420197003505233862.post-1321021015218874577</id><published>2011-04-13T14:05:00.000-04:00</published><updated>2011-04-13T14:05:15.046-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>How to use SPQuery to find a file in a document library</title><content type='html'>Note that Title field is null and BaseName field throws some weird SQL exception.&lt;br /&gt;&lt;pre&gt;SPList list = web.Lists["My Lib"];&lt;br /&gt;SPQuery query = new SPQuery();&lt;br /&gt;query.Query = "&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\"&lt;b&gt;FileLeafRef&lt;/b&gt;\"/&amp;gt;&lt;br /&gt; &amp;lt;Value Type=\"Text\"&amp;gt;file.ext&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;";&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1321021015218874577?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1321021015218874577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/04/how-to-use-spquery-to-find-file-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1321021015218874577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1321021015218874577'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/04/how-to-use-spquery-to-find-file-in.html' title='How to use SPQuery to find a file in a document library'/><author><name>val</name><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-4420197003505233862.post-8333650531620252080</id><published>2011-04-06T13:40:00.001-04:00</published><updated>2011-04-06T13:40:33.514-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>Sharepoint content deployment job stuck in Preparing state</title><content type='html'>I just attempted to run a content deployment job that is known to work because I ran it quite a number of times already, only to have it sit in Preparing state for some time. Trace logs meanwhile showed a lot of errors along the lines of &lt;br /&gt;&lt;pre&gt;The previous instance of the timer job ‘Config Refresh’, &lt;br /&gt;id '{GUID}’ for service ‘{GUID}’ is still running, &lt;br /&gt;so the current instance will be skipped. &lt;br /&gt;Consider increasing the interval between jobs.&lt;/pre&gt;Eventually I found &lt;a href="http://blogs.msdn.com/b/josrod/archive/2007/12/12/clear-the-sharepoint-configuration-cache-for-timer-job-and-psconfig-errors.aspx"&gt;this post&lt;/a&gt; about clearing up the configuration cache. Following the steps there resolved the problem, but I wonder if just resetting the Timer Service would not have been enough.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8333650531620252080?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8333650531620252080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/04/sharepoint-content-deployment-job-stuck.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8333650531620252080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8333650531620252080'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/04/sharepoint-content-deployment-job-stuck.html' title='Sharepoint content deployment job stuck in Preparing state'/><author><name>val</name><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-4420197003505233862.post-7171183049232910431</id><published>2011-04-05T14:12:00.002-04:00</published><updated>2011-04-05T14:14:03.795-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>ApplyWebConfigModifications does not work in a Farm with multiple WFEs</title><content type='html'>I finally got around to investigating a deployment issue we had a few weeks ago. Basically, the modifications to web.config using ApplyWebConfigModifications() were only applied to one of two web front ends. Eventually I found &lt;a href="http://solutionizing.net/2009/05/26/spwebconfigmodification-works-fine/"&gt;this post&lt;/a&gt;. So the proper way of doing it is:&lt;br /&gt;&lt;pre&gt;webApp.WebConfigModifications.Add(...);&lt;br /&gt;&lt;b&gt;webApp.Update();&lt;/b&gt; &lt;-- this was my problem&lt;br /&gt;webApp.Farm.Services.GetValue&amp;lt;SPWebService&amp;gt;().ApplyWebConfigModifications();&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7171183049232910431?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7171183049232910431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/04/applywebconfigmodifications-does-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7171183049232910431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7171183049232910431'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/04/applywebconfigmodifications-does-not.html' title='ApplyWebConfigModifications does not work in a Farm with multiple WFEs'/><author><name>val</name><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-4420197003505233862.post-5026399551133897451</id><published>2011-03-13T22:07:00.000-04:00</published><updated>2011-03-13T22:07:37.730-04:00</updated><title type='text'>Microsoft.ACE.OLEDB.12.0 provider is not registered</title><content type='html'>Lots of posts out there. The end result is&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Make sure either Office or &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&amp;amp;displaylang=en"&gt;Office Data Connectivity Components&lt;/a&gt; are installed&lt;/li&gt;&lt;li&gt;Make sure the project is compiled in x86 mode as the provider apparently does not work in 64 bit. &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5026399551133897451?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5026399551133897451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/03/microsoftaceoledb120-provider-is-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5026399551133897451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5026399551133897451'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/03/microsoftaceoledb120-provider-is-not.html' title='Microsoft.ACE.OLEDB.12.0 provider is not registered'/><author><name>val</name><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-4420197003505233862.post-8141852419401489490</id><published>2011-03-09T14:04:00.003-05:00</published><updated>2011-03-09T14:30:53.242-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Chart Controls'/><title type='text'>MSChartControls update for Sharepoint 2010</title><content type='html'>I had a MOSS project with a number of custom web parts which are using MSChart controls from System.Web.UI.DataVisualization.Charting namespace. After migrating it to Sharepoint 2010 none of the pages with those charts were displayed. The error log message was &lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;System.Web.HttpException: No http handler was found for request type 'GET'&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;at System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig, Boolean convertNativeStaticFileModule)&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: small;"&gt;at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;etc &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After much googling, it appeared that for IIS7, which hosts Sharepoint 2010 sites, an additional web.config entry needs to be added under system.webServer/handlers element for ChartImg.axd handler to work:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: #a31515;"&gt;add&lt;/span&gt; &lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;ChartImageHandler&lt;/span&gt;" &lt;span style="color: red;"&gt;preCondition&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;integratedMode&lt;/span&gt;" &lt;span style="color: red;"&gt;verb&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*&lt;/span&gt;&lt;span style="color: blue;"&gt;"&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: red;"&gt;path&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;ChartImg.axd&lt;/span&gt;" &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: blue; font-size: small;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This setting is in addition to the rest of web.config changes required for MSChart controls to work:&lt;br /&gt;&lt;span style="font-size: 16px;"&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-family: Courier New; font-size: small;"&gt;appSettings&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: #a31515;"&gt;add&lt;/span&gt; &lt;span style="color: red;"&gt;key&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;ChartImageHandler&lt;/span&gt;" &lt;span style="color: red;"&gt;value&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;storage=memory;timeout=20;&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: #a31515;"&gt;appSettings&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: #a31515;"&gt;httpHandlers&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: #a31515;"&gt;add&lt;/span&gt; &lt;span style="color: red;"&gt;path&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;ChartImg.axd&lt;/span&gt;" &lt;span style="color: red;"&gt;verb&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*&lt;/span&gt;" &lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.Web.UI.DataVisualization.Charting.ChartHttpHandler,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&lt;/span&gt;"&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;span style="color: red;"&gt;validate&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;false&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt; /&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515; font-family: inherit; font-size: small;"&gt;httpHandlers&lt;/span&gt;&lt;span style="color: blue; font-family: inherit; font-size: small;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Plus any SafeControls entries&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8141852419401489490?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8141852419401489490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/03/mschartcontrols-update-for-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8141852419401489490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8141852419401489490'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/03/mschartcontrols-update-for-sharepoint.html' title='MSChartControls update for Sharepoint 2010'/><author><name>val</name><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-4420197003505233862.post-5414921229240434736</id><published>2011-03-02T18:14:00.001-05:00</published><updated>2011-03-02T18:15:43.996-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom Edit  Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='DataFormWebPart'/><title type='text'>How to customize Sharepoint FormField control's appearance</title><content type='html'>I get a lot of requirements recently related to customizations of Display, Edit and New forms for Sharepoint list items. Most of them can be implemented by customizing the form following the steps &lt;a href="http://vkirshin.blogspot.com/2011/03/how-to-create-custom-display-edit-or.html"&gt;here&lt;/a&gt;. E.g. fonts, colors and all CSS attributes can be changed; fields can be rearranged in different order or displayed in several columns; buttons can be added to the toolbar as well as client-side validation and other javascript goodies, etc. But there's more, the way the fields are rendered can also be changed.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;The requirement I had today was about a lookup field that allows multiple values. Corresponding FormField is displayed like this:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh4.googleusercontent.com/-yLKi4pp1TEA/TW7O-e4AWvI/AAAAAAAAASU/65kNHcn6YkU/s1600/Lookup.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh4.googleusercontent.com/-yLKi4pp1TEA/TW7O-e4AWvI/AAAAAAAAASU/65kNHcn6YkU/s1600/Lookup.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;They wanted to enlarge the lookup list boxes to allow users to see long valued without scrolling. But the list is generated by the FormField control, so how do you modify it? Fortunately, FormField is a template control, so its appearance can easily be changed by providing a custom Template element. The default template for Multiple Lookup Field is called MultipleLookupField, located in 12\TEMPLATE\CONTROLTEMPLATES\DefaultTemplates.ascx and looks like this (I changed it to a well-formed XML)&lt;br /&gt;&lt;pre&gt;&amp;lt;Template&amp;gt;&lt;br /&gt;  &amp;lt;SharePoint:GroupedItemPicker id="MultiLookupPicker" runat="server"&lt;br /&gt;    CandidateControlId="SelectCandidate"&lt;br /&gt;    ResultControlId="SelectResult"&lt;br /&gt;    AddButtonId="AddButton"&lt;br /&gt;    RemoveButtonId="RemoveButton"&lt;br /&gt;   /&amp;gt;&lt;br /&gt;  &amp;lt;table class="ms-long" cellpadding="0" cellspacing="0" border="0"&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;      &amp;lt;td class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;SharePoint:SPHtmlSelect id="SelectCandidate" &lt;br /&gt;               Width="143" Height="125" runat="server" multiple="true" /&amp;gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;      &amp;lt;td style="padding-left:10px"/&amp;gt;&lt;br /&gt;      &amp;lt;td align="center" valign="middle" class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;button class="ms-buttonheightwidth" ID="AddButton" runat="server"&amp;gt;&lt;br /&gt;          &amp;lt;SharePoint:EncodedLiteral runat="server" &lt;br /&gt;               text="&amp;amp;lt;%$Resources:wss,multipages_gip_add%&amp;amp;gt;" EncodeMethod='HtmlEncode'/&amp;gt;&lt;br /&gt;        &amp;lt;/button&amp;gt;&lt;br /&gt;        &amp;lt;br/&amp;gt;&lt;br /&gt;        &amp;lt;br/&amp;gt;&lt;br /&gt;        &amp;lt;button class="ms-buttonheightwidth" ID="RemoveButton" runat="server"&amp;gt;&lt;br /&gt;          &amp;lt;SharePoint:EncodedLiteral runat="server" &lt;br /&gt;               text="&amp;amp;lt;%$Resources:wss,multipages_gip_remove%&amp;amp;gt;" EncodeMethod='HtmlEncode'/&amp;gt;&lt;br /&gt;        &amp;lt;/button&amp;gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;      &amp;lt;td style="padding-left:10px"/&amp;gt;&lt;br /&gt;      &amp;lt;td class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;SharePoint:SPHtmlSelect id="SelectResult" &lt;br /&gt;               Width="143" Height="125" runat="server" multiple="true" /&amp;gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/Template&amp;gt;&lt;/pre&gt;&lt;br /&gt;To change it, I suggest first to add the default one to the FormField on the form:&lt;br /&gt;&lt;pre&gt;&amp;lt;SharePoint:FormField runat="server" ...&amp;gt;&lt;br /&gt;  &amp;lt;Template&amp;gt;&lt;br /&gt;     template content&lt;br /&gt;  &amp;lt;/Template&amp;gt;&lt;br /&gt;&amp;lt;/SharePoint:FormField&amp;gt;&lt;/pre&gt;&lt;br /&gt;and then modify the template as needed. E.g. my template is as follows:&lt;br /&gt;&lt;pre&gt;&amp;lt;Template&amp;gt;&lt;br /&gt;  &amp;lt;SharePoint:GroupedItemPicker id="MultiLookupPicker" runat="server"&lt;br /&gt;    CandidateControlId="SelectCandidate"&lt;br /&gt;    ResultControlId="SelectResult"&lt;br /&gt;    AddButtonId="AddButton"&lt;br /&gt;    RemoveButtonId="RemoveButton"&lt;br /&gt;           /&amp;gt;&lt;br /&gt;  &amp;lt;table class="ms-long" cellpadding="0" cellspacing="0" border="0"&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;      &amp;lt;td class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;SharePoint:SPHtmlSelect id="SelectResult" &lt;br /&gt;            Width="400" Height="125" runat="server" multiple="true" /&amp;gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;      &amp;lt;td align="center" valign="middle" class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;button class="ms-buttonheightwidth" ID="AddButton" runat="server"&amp;gt;&lt;br /&gt;          &amp;lt;SharePoint:EncodedLiteral runat="server" text="Add" EncodeMethod='HtmlEncode'/&amp;gt;&lt;br /&gt;        &amp;lt;/button&amp;gt;&lt;br /&gt;        &amp;lt;button class="ms-buttonheightwidth" ID="RemoveButton" runat="server"&amp;gt;&lt;br /&gt;          &amp;lt;SharePoint:EncodedLiteral runat="server" text="Remove" EncodeMethod='HtmlEncode'/&amp;gt;&lt;br /&gt;        &amp;lt;/button&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;tr&amp;gt;&lt;br /&gt;      &amp;lt;td class="ms-input"&amp;gt;&lt;br /&gt;        &amp;lt;SharePoint:SPHtmlSelect id="SelectCandidate" &lt;br /&gt;            Width="400" Height="125" runat="server" multiple="true" /&amp;gt;&lt;br /&gt;      &amp;lt;/td&amp;gt;&lt;br /&gt;    &amp;lt;/tr&amp;gt;&lt;br /&gt;  &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/Template&amp;gt;&lt;/pre&gt;&lt;br /&gt;and looks like this&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-PimCHBzb0BQ/TW7PEDh07PI/AAAAAAAAASY/ijJT4KbXa8E/s1600/LookupMod.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-PimCHBzb0BQ/TW7PEDh07PI/AAAAAAAAASY/ijJT4KbXa8E/s1600/LookupMod.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5414921229240434736?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5414921229240434736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/03/how-to-customize-sharepoint-formfield.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5414921229240434736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5414921229240434736'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/03/how-to-customize-sharepoint-formfield.html' title='How to customize Sharepoint FormField control&apos;s appearance'/><author><name>val</name><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='https://lh4.googleusercontent.com/-yLKi4pp1TEA/TW7O-e4AWvI/AAAAAAAAASU/65kNHcn6YkU/s72-c/Lookup.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-5204444555294532385</id><published>2011-03-02T17:38:00.000-05:00</published><updated>2011-03-02T17:38:49.812-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DVWP'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='DataFormWebPart'/><title type='text'>How to create a custom Display, Edit or New List Item form in SharePoint 2007</title><content type='html'>1. Open the Sharepoint Designer, navigate to and expand your list:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh5.googleusercontent.com/-7e5xyuaw8Vk/TW7GkbDZ9DI/AAAAAAAAASM/RYdIDvdpXlM/s1600/MyList.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh5.googleusercontent.com/-7e5xyuaw8Vk/TW7GkbDZ9DI/AAAAAAAAASM/RYdIDvdpXlM/s1600/MyList.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;2. Make a copy of the form you want to modify and open the copied form&lt;br /&gt;3. Select the ListFormWebPart and delete it. For some reason when I attempt to delete it from the Design tab it errors out with "An error occured while attempting to write the file", so I delete it from the code tab.&lt;br /&gt;4. Choose Insert/Sharepoint Controls/Custom List form from the menu&lt;br /&gt;5. Select the list, content type and the type of form you want&lt;br /&gt;6. It will generate a DataFormWebPart with FormField controls for each field in your list. DataFormWebPart is the same as DataViewWebPart in that it is also XSLT-based. So now you can make whatever modifications you need.&lt;br /&gt;7. Once you're done, right-click on your list in SharePoint Designer, select Properties and on the following dialog click on the Supporting Files tab&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh3.googleusercontent.com/-2X6Rat_aa5g/TW7GsCTY9gI/AAAAAAAAASQ/LUgxzWA9b94/s1600/MyListProperties.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh3.googleusercontent.com/-2X6Rat_aa5g/TW7GsCTY9gI/AAAAAAAAASQ/LUgxzWA9b94/s1600/MyListProperties.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;8. Now select Item (or whatever content type you want, but not Folder) from the drop down and specify your modified page instead of out of the box Display, Edit or New page. You're done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5204444555294532385?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5204444555294532385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/03/how-to-create-custom-display-edit-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5204444555294532385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5204444555294532385'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/03/how-to-create-custom-display-edit-or.html' title='How to create a custom Display, Edit or New List Item form in SharePoint 2007'/><author><name>val</name><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='https://lh5.googleusercontent.com/-7e5xyuaw8Vk/TW7GkbDZ9DI/AAAAAAAAASM/RYdIDvdpXlM/s72-c/MyList.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-9170556460809742279</id><published>2011-02-22T13:45:00.001-05:00</published><updated>2011-02-22T13:58:35.224-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Sharepoint custom edit form error: Input string was not in a correct format</title><content type='html'>I customized the edit form of a Sharepoint list, i.e.&lt;br /&gt;- Opened EditDisp.aspx in the Designer&lt;br /&gt;- Deleted existing ListFormWebPart&lt;br /&gt;- Added a custom form through Insert/SharePoint Controls/Custom List form menu&lt;br /&gt;- Made the customizations I wanted.&lt;br /&gt;&lt;br /&gt;All is well, except that after each modification of the edit form, the first time it is opened I get the following error while trying to save the data:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;[FormatException: Input string was not in a correct format.]&lt;br /&gt;System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) +7471479&lt;br /&gt;System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119&lt;br /&gt;System.Convert.ToInt32(String value, IFormatProvider provider) +48&lt;br /&gt;Microsoft.SharePoint.WebControls.ItemHiddenVersion.OnLoad(EventArgs e) +293&lt;br /&gt;System.Web.UI.Control.LoadRecursive() +50&lt;br /&gt;etc &lt;br /&gt;&lt;br /&gt;Looking at ItemHiddenVersion in the Reflector did not give me any ideas. Then I looked at the form. Basically it is a DataViewWebPart that instantiates a bunch of Sharepoint server controls via XSLT. I had problems with that approach in the past. So I found the ItemHiddenVersion control in the XSLT and moved it out of the DataViewWebPart, actually out of the WebPartZone altogether. The error is gone and the version seem to be handled correctly still. Which is not surprising because Sharepoint form controls use SPContext to get the ListItem, so it should not matter where on the page the control is located.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-9170556460809742279?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/9170556460809742279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/02/sharepoint-custom-edit-form-error-input.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9170556460809742279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9170556460809742279'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/02/sharepoint-custom-edit-form-error-input.html' title='Sharepoint custom edit form error: Input string was not in a correct format'/><author><name>val</name><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-4420197003505233862.post-2045133984332691035</id><published>2011-02-18T20:27:00.005-05:00</published><updated>2011-03-08T15:16:29.282-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>DataView bits</title><content type='html'>Link&lt;br /&gt;&amp;lt;a href="Lists/MyList/DispFormCust.aspx?ID={@ID}" onfocus="OnLink(this)" onclick="GoToLink(this);return false;" target="_self"&amp;gt;&lt;br /&gt;&lt;br /&gt;Edit Link&lt;br /&gt;&amp;lt;a href="Lists/MyList/EditFormCust.aspx?ID={@ID}" onclick="GoToLink(this);return false;" target="_self"&amp;gt;&amp;lt;img border="0" alt="Edit" src="/_layouts/images/edititem.gif" /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;Open documents from Sharepoint in Edit mode instead of Read-Only&lt;br /&gt;&amp;lt;a href="document.xlsx" onclick="StsOpenEnsureEx('SharePoint.OpenDocuments.3').EditDocument2(window, this.href, '');return false;"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.wssdemo.com/Blog/archive/2007/08/04/sharepoint-data-view-conditional-formatting-based-on-user-permissions.aspx"&gt;ddwrt:IfHasRights() permission masks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;AppendOnly Edit/NewForm control&lt;br /&gt;&amp;lt;SharePoint:AppendOnlyHistory runat="server" id="ff2b{$Pos}" controlmode="Display" fieldname="ggg"&amp;gt;&amp;lt;/SharePoint:AppendOnlyHistory&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2045133984332691035?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2045133984332691035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/02/dataview-bits.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2045133984332691035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2045133984332691035'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/02/dataview-bits.html' title='DataView bits'/><author><name>val</name><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-4420197003505233862.post-3299126151688399319</id><published>2011-02-12T21:08:00.000-05:00</published><updated>2011-02-12T21:08:22.377-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Administration'/><title type='text'>Network Access to SQL Server Named Instance</title><content type='html'>I was setting up a new MOSS farm and got the following error while running the Configuration Wizard:&lt;br /&gt;An exception of type System.Data.SqlClient.SqlException was thrown.  Additional exception information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)&lt;br /&gt;&lt;br /&gt;Fine, I thought, so I do not have firewall rule for TCP 1433 open, big deal. However, this time I set up a named instance of SQL Server, therefore it was not using the standard port, in fact it is configured by default to use dynamic TCP port. So to make it work:&lt;br /&gt;- Make sure SQL Browser is running and firewall has its UDP 1434 port open&lt;br /&gt;- Make named instance use a specific port number using SQL Server configuration manager. It is described &lt;a href="http://technet.microsoft.com/en-us/library/ms177440.aspx"&gt;here&lt;/a&gt;, but what I needed to do in addition is to set both Active and Enabled to "yes" for the IP address I wanted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3299126151688399319?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3299126151688399319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/02/network-access-to-sql-server-named.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3299126151688399319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3299126151688399319'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/02/network-access-to-sql-server-named.html' title='Network Access to SQL Server Named Instance'/><author><name>val</name><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-4420197003505233862.post-5935163338636205205</id><published>2011-01-30T22:00:00.004-05:00</published><updated>2011-01-31T18:05:36.199-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Configuring Sharpoint Server 2010</title><content type='html'>Bits and pieces about configuring Sharpoint Server 2010&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Could not start User Profile Syncronization service. It says Starting and then Stopped. Added the farm account to the local Administrators group and then restarted the timer service.&lt;br /&gt;&lt;br /&gt;User Profile Synchronization Connection to Active Directory needs a user account with Replicating Directory Changes permissions configurable in adsiedit per &lt;a href="http://technet.microsoft.com/en-us/library/ee721049.aspx#ADProcedures"&gt;http://technet.microsoft.com/en-us/library/ee721049.aspx#ADProcedures&lt;/a&gt;&lt;br /&gt;The problem is, it does not allow me to modify security settings. The Add button is grayed out. To enable it, make sure your account is a member of Enterprise Admins group (I had to add my account to the group, then log off and log back on for it to work)&lt;br /&gt;&lt;br /&gt;In MOSS user's email is edited in Shared Services/User Profiles and properties. To get there you got to have Search configured and running (and it has to be associated with User Profile? There was some additional step which I now forgot). &lt;br /&gt;&lt;br /&gt;Now, to send emails to document library, "poor man's" version:&lt;br /&gt;1. Configure SMTP and Incoming Email settings per e.g. http://jopx.blogspot.com/2006/11/configuring-incoming-email-settings-in.html&lt;br /&gt;2. If "Accept e-mail messages based on document library permissions" is checked, then make sure that when you are testing it, the x-sender email header specifies the correct email. It has to be fully qualified, i.e. user@domain.com rather than user@domain. Apparently, to find the user by email address MOSS looks in the User Profile records but also does an Active Directory lookup. So if a user has "work email" in User Profile as email1@domain.com and at the same time has email in the AD as email2@domain.com, then any of those emails will correctly identify the user. Until the next User Profile Sync, I guess :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5935163338636205205?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5935163338636205205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/01/configuring-sharpoint-server-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5935163338636205205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5935163338636205205'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/01/configuring-sharpoint-server-2010.html' title='Configuring Sharpoint Server 2010'/><author><name>val</name><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-4420197003505233862.post-1603576655555087246</id><published>2011-01-25T17:25:00.000-05:00</published><updated>2011-01-25T17:25:29.009-05:00</updated><title type='text'>Copy local user profile to domain profile</title><content type='html'>&lt;a href="http://www.petri.co.il/forums/showpost.php?p=25681&amp;amp;postcount=10"&gt;From here&lt;/a&gt;&lt;br /&gt;1. log in as DOMAIN\user to create a profile (folder) and log off&lt;br /&gt;2. log in as DOMAIN\administrator &lt;br /&gt;3. make all files visible in folder options or run the appropriate file manager&lt;br /&gt;4. move (not copy) all that you have in local user profile folder to newly created domain user profile folder&lt;br /&gt;5. check permissions on domain user folder (must be set to domain user full access)&lt;br /&gt;6. run regedit&lt;br /&gt;7. go to HKEY_Users, then choose File -&amp;gt; Load Hive, choose file ntuser.dat (user registry file) in domain user profile folder&lt;br /&gt;8. check permissions again&lt;br /&gt;9. Unload hive&lt;br /&gt;10.log off and log on as Domain\user&lt;br /&gt;&lt;br /&gt;Worked on Windows 2003 Server R2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1603576655555087246?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1603576655555087246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/01/copy-local-user-profile-to-domain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1603576655555087246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1603576655555087246'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/01/copy-local-user-profile-to-domain.html' title='Copy local user profile to domain profile'/><author><name>val</name><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-4420197003505233862.post-8142664857468723392</id><published>2011-01-25T17:08:00.000-05:00</published><updated>2011-01-25T17:08:14.539-05:00</updated><title type='text'>Cannot delete files from Favorites folder under user profile in Windows Server 2003</title><content type='html'>This was the strangest and the most annoying thing today. I tried to delete a user profile from Windows 2003 Server only to get Access Denied error while deleting some .url shortcuts under Favorites folder. What's more, I was logged in under Administrator account, the Properties dialog for the file did not show the Security tab and I got same Access Denied when trying to change the ownership or permissions from the parent folder. After poking around on the internet, I stopped the Indexing Service and then those files disappeared and I was able to remove the profile. I do not have time nor inclination to figure out exactly what was going on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8142664857468723392?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8142664857468723392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/01/cannot-delete-files-from-favorites.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8142664857468723392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8142664857468723392'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/01/cannot-delete-files-from-favorites.html' title='Cannot delete files from Favorites folder under user profile in Windows Server 2003'/><author><name>val</name><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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-1199513186026002567</id><published>2011-01-10T15:46:00.003-05:00</published><updated>2011-05-07T11:39:58.588-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Reporting Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SQL Reporting Service reports on Sharepoint list</title><content type='html'>So that I do not forget it next time. There are two ways. &lt;br /&gt;If it is SQL Server 2008 R2, then create a new report project in the studio. Then select Add New Report. Set the data source type to Microsoft Sharepoint List (it now supports it natively, how cool is that!). The connection string is http://host/site. The query is basically a CAML Query:&lt;br /&gt;&lt;pre&gt;&amp;lt;RSSharePointList&amp;gt;&lt;br /&gt;&amp;lt;ListName&amp;gt;MyList&amp;lt;/ListName&amp;gt;&lt;br /&gt;&amp;lt;ViewFields&amp;gt;&lt;br /&gt;  &amp;lt;FieldRef Name=&amp;quot;Title&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;FieldRef Name=&amp;quot;Created&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/ViewFields&amp;gt;&lt;br /&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;  &amp;lt;Where&amp;gt;&lt;br /&gt;      &amp;lt;IsNotNull&amp;gt;&lt;br /&gt;        &amp;lt;FieldRef Name=&amp;quot;Title&amp;quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/IsNotNull&amp;gt; &lt;br /&gt;  &amp;lt;/Where&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt;&lt;br /&gt;&amp;lt;/RSSharePointList&amp;gt;&lt;br /&gt;&lt;/pre&gt;That's it, from there just use the wizard to design the report.&lt;br /&gt;&lt;br /&gt;Now, with SQL Server 2008 you got to use web services. So the data source type will be XML, the connection string http://host/site/_vti_bin/Lists.asmx. Then the query is an XmlDP:&lt;br /&gt;&lt;pre&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;  &amp;lt;SoapAction&amp;gt;http://schemas.microsoft.com/sharepoint/soap/GetListItems&amp;lt;/SoapAction&amp;gt;&lt;br /&gt;  &amp;lt;Method Namespace=&amp;quot;http://schemas.microsoft.com/sharepoint/soap/&amp;quot; &lt;br /&gt;      Name=&amp;quot;GetListItems&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;Parameters&amp;gt;&lt;br /&gt;      &amp;lt;Parameter Name=&amp;quot;listName&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;DefaultValue&amp;gt;MyList&amp;lt;/DefaultValue&amp;gt;&lt;br /&gt;      &amp;lt;/Parameter&amp;gt;&lt;br /&gt;      &amp;lt;Parameter Name=&amp;quot;query&amp;quot; Type=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;DefaultValue&amp;gt;&lt;br /&gt;          &amp;lt;Query&amp;gt;&lt;br /&gt;            &amp;lt;Where&amp;gt;&lt;br /&gt;              &amp;lt;Eq&amp;gt;&lt;br /&gt;                &amp;lt;FieldRef Name=&amp;quot;MyField&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;Value Type=&amp;quot;Text&amp;quot;&amp;gt;MyValue&amp;lt;/Value&amp;gt;&lt;br /&gt;              &amp;lt;/Eq&amp;gt;&lt;br /&gt;            &amp;lt;/Where&amp;gt;&lt;br /&gt;          &amp;lt;/Query&amp;gt;&lt;br /&gt;        &amp;lt;/DefaultValue&amp;gt;&lt;br /&gt;      &amp;lt;/Parameter&amp;gt;&lt;br /&gt;    &amp;lt;/Parameters&amp;gt;&lt;br /&gt;  &amp;lt;/Method&amp;gt;&lt;br /&gt;  &amp;lt;ElementPath IgnoreNamespaces=&amp;quot;True&amp;quot;&amp;gt;*&amp;lt;/ElementPath&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt;&lt;/pre&gt;The query parameter is a CAML query again. The above will return all fields in the list. The web service accepts viewFields parameter (and, actually, a bunch of other parameters) as well. Note: watch for case of tags/attributes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1199513186026002567?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1199513186026002567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2011/01/sql-reporting-service-reports-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1199513186026002567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1199513186026002567'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2011/01/sql-reporting-service-reports-on.html' title='SQL Reporting Service reports on Sharepoint list'/><author><name>val</name><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-4420197003505233862.post-7490804174821470593</id><published>2010-12-28T12:38:00.004-05:00</published><updated>2011-11-17T10:47:53.421-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='DataFormWebPart'/><title type='text'>The web part does not have a valid XSLT stylesheet: Error: A name was started with an invalid character.</title><content type='html'>Here's a better &lt;a href="http://www.eggheadcafe.com/software/aspnet/30460322/spd-2007--fails-to-convert-list-to-xslt-view.aspx"&gt;description&lt;/a&gt;. But basically, when SharePoint Designer 2007 converts a list view with Edit field to a Data View it screws up the XSLT. Note that there are many other ways to screw up DataView's XSLT.&lt;br /&gt;&lt;br /&gt;The problem is indeed with the code&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:choose&amp;gt;&lt;br /&gt;  &amp;lt;xsl:when test="ddwrt:IfHasRights(4)"&amp;gt;&lt;br /&gt;    &amp;lt;a href="{$URL_Edit}?ID={@ID}" onclick="STSNavigateWithCheckoutAlert(this.href,&lt;br /&gt;     '&amp;apos;lt;xsl:choose&amp;apos;gt;&amp;apos;lt;&lt;br /&gt;    xsl:when test=" @CheckedOutUserId=""&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select="ddwrt:ListProperty('ForceCheckout')" /&amp;gt;&lt;br /&gt;    &amp;lt;/a&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;  &amp;lt;xsl:otherwise&amp;gt;0&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;&amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;&amp;apos;apos;,&amp;apos;apos;&amp;lt;xsl:value-of select="$&lt;b&gt;&lt;u&gt;FieldIDA4O2K&lt;/u&gt;&lt;/b&gt;" /&amp;gt;&amp;apos;apos;,&amp;apos;apos;/&amp;lt;&lt;br /&gt;    xsl:value-of select="@FileRef" /&amp;gt;&amp;apos;apos;,&lt;br /&gt;    &amp;apos;apos;&amp;lt;xsl:value-of select="$HttpVDir" /&amp;gt;&amp;apos;apos;) ;&lt;br /&gt;    return false;&amp;apos;quot; target=&amp;apos;quot;_self&amp;apos;quot;&lt;br /&gt;    &amp;apos;gt;&amp;lt;img border="0" alt="Edit Document Properties" &lt;br /&gt;    src="/_layouts/images/edititem.gif" /&amp;gt;&lt;br /&gt;&amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;  &amp;lt;xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" &lt;br /&gt;    ddwrt:nbsp-preserve="yes" disable-output-escaping="yes"&amp;gt;&amp;apos;amp;nbsp;&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;&amp;lt;/xsl:otherwise&amp;gt;&lt;/pre&gt;It is completely malformed. I guess they meant this&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:choose&amp;gt;&lt;br /&gt;  &amp;lt;xsl:when test="ddwrt:IfHasRights(4)"&amp;gt;&lt;br /&gt;    &amp;lt;a href="{$URL_Edit}?ID={@ID}" target="_self"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:attribute name="onclick"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:text&amp;gt;STSNavigateWithCheckoutAlert(this.href, '&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;        &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;          &amp;lt;xsl:when test="@CheckedOutUserId"&amp;gt;&lt;br /&gt;            &amp;lt;xsl:value-of select="ddwrt:ListProperty('ForceCheckout')" /&amp;gt;&lt;br /&gt;          &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;          &amp;lt;xsl:otherwise&amp;gt;0&amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;        &amp;lt;xsl:text&amp;gt;','&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="$&lt;b&gt;&lt;u&gt;FieldIDA4O2K&lt;/u&gt;&lt;/b&gt;" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:text&amp;gt;','&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="@FileRef" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:text&amp;gt;','&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="$HttpVDir" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:text&amp;gt;') ;return false;&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;      &amp;lt;img border="0" alt="Edit Document Properties" src="/_layouts/images/edititem.gif" /&amp;gt;&lt;br /&gt;    &amp;lt;/a&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;  &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" &lt;br /&gt;    ddwrt:nbsp-preserve="yes" disable-output-escaping="yes"&amp;gt;&amp;amp;nbsp;&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;&amp;lt;/xsl:choose&amp;gt;&lt;/pre&gt;Note the parameter name in bold which will be different every time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7490804174821470593?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7490804174821470593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/12/web-part-does-not-have-valid-xslt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7490804174821470593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7490804174821470593'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/12/web-part-does-not-have-valid-xslt.html' title='The web part does not have a valid XSLT stylesheet: Error: A name was started with an invalid character.'/><author><name>val</name><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-4420197003505233862.post-3640076646444332433</id><published>2010-12-22T15:51:00.000-05:00</published><updated>2010-12-22T15:51:58.894-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Sharepoint 2010 In-Place Upgrade fails with DoRemoveIsapiExtensionRestriction exception</title><content type='html'>The exact error message in the log file is&lt;br /&gt;&lt;pre&gt;Exception: DoRemoveIsapiExtensionRestriction Windows &lt;br /&gt;SharePoint Services V3 failed&lt;/pre&gt;Intall the prerequisites. If you had already installed them, then install them again. and then re-run the upgrade &lt;br /&gt;&lt;pre&gt;psconfig -cmd upgrade&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3640076646444332433?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3640076646444332433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/12/sharepoint-2010-in-place-upgrade-fails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3640076646444332433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3640076646444332433'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/12/sharepoint-2010-in-place-upgrade-fails.html' title='Sharepoint 2010 In-Place Upgrade fails with DoRemoveIsapiExtensionRestriction exception'/><author><name>val</name><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-4420197003505233862.post-3679949044987574931</id><published>2010-12-15T13:57:00.000-05:00</published><updated>2010-12-15T13:57:41.732-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Populate ListItem fields in IntemAdding event handler</title><content type='html'>In ItemAdding handler the properties.ListItem property is null, because the item has not been created yet. Properties of the new item are stored in AfterProperties collection:&lt;pre&gt;public override void ItemAdding(SPItemEventProperties properties)&lt;br /&gt;{&lt;br /&gt;   properties.AfterProperties["MyField"] = "value";&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3679949044987574931?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3679949044987574931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/12/populate-listitem-fields-in-intemadding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3679949044987574931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3679949044987574931'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/12/populate-listitem-fields-in-intemadding.html' title='Populate ListItem fields in IntemAdding event handler'/><author><name>val</name><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-4420197003505233862.post-5404298535578768913</id><published>2010-11-21T17:58:00.001-05:00</published><updated>2010-11-21T17:59:25.691-05:00</updated><title type='text'>Why I like developing with Sharepoint</title><content type='html'>As both an experienced ASP.Net and Sharepoint architect I am being repeatedly asked what is better – ASP.Net or Sharepoint? Which platform my client’s organization should choose for the next project? For me it was a very simple choice: at one point I was asked to look into Sharepoint development and since then I never looked back. I believe developing web applications with Sharepoint can be vastly more productive and therefore cost effective than using just ASP.Net. The downside, however, is the learning curve and certain prejudice among ASP.Net developers. Let’s see how developers can actually benefit from Sharepoint.&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;User interface&lt;/h2&gt;From the perspective of an ASP.Net developer a unified, standard UI is almost a blessing. First, there’s no need to create application’s UI from scratch anymore because there’s a blueprint already. Second, it provides a baseline UI. Why is it important? Because now there is a “standard” way to do things, “standard” color scheme (which comes from corporate branding, by the way), “standard” fonts, etc. There still will be requests to tweak the UI, of course, but in the standard UI is a great thing. &lt;br /&gt;&lt;br /&gt;Also, if Sharepoint is being used within the company already, then the learning curve for the end users of the application will be minimal since it uses the familiar UI.&lt;br /&gt;&lt;br /&gt;Developers, however, are not limited to only using web parts and Sharepoint controls. After all, Sharepoint pages are still ASP.Net pages, thus everything ASP.Net does can be done in Sharepoint. &lt;br /&gt;&lt;h2&gt;Extensibility and data access&lt;/h2&gt;It is a fairly common to have a need to combine data from different custom systems. It is also just as common for IT to say that it is impossible because no one knows how to get the data out of those systems. Imagine the frustration when the data is there, but you cannot get to it because the data store is a closed black box. Whereas properly developed Sharepoint application has all its data exposed via well-known channels such as lists or web parts. On top of that any data stored in Sharepoint list it is automatically available through a web service.&lt;br /&gt;&lt;br /&gt;From the development perspective Sharepoint allows to avoid the effort of creating, testing and maintaining of the data access code. The data in lists can also be easily shared between independent applications even without the help of original developers. But Sharepoint application is not limited to lists for data storage and can utilize all data access technologies provided by .Net, including ADO.Net, LINQ and Entity Framework. &lt;br /&gt;&lt;h2&gt;Maintenance and deployment&lt;/h2&gt;Because ASP.Net gives developers complete freedom over how to set it up, configure, maintain, where and how store the data, etc, the end result is that each application ends up doing those things differently. Therefore system administrators must deal with and keep track of each application’s different requirements thus increasing the maintenance burden. Sharepoint, on the other hand, provides common way to deploy, manage and scale applications. &lt;br /&gt;&lt;h2&gt;Security and testing&lt;/h2&gt;Sharepoint employs all the same security facilities available to ASP.Net applications, so it is no less secure. However, many security vulnerabilities, e.g. SQL Injection, result from bugs in the application code rather than from framework or operating system. In this regard Sharepoint has a clear advantage because it has been already tested by millions of users. Poorly written application can still introduce security issues but at least the facilities provided by Sharepoint are known to work. &lt;br /&gt;&lt;br /&gt;Testing is a closely related area because once again, properly created Sharepoint application will strive to utilize as much out of the box functionality as possible and that functionality requires virtually no testing. &lt;br /&gt;&lt;h2&gt;Workflows&lt;/h2&gt;It is well known that workflows play a significant role in any business. Microsoft shipped Workflow Foundation as part of .Net 3.0 at the same time Sharepoint 2007 was released. In fact, WF was developed for Sharepoint which explains why the two work together so well. &lt;br /&gt;&lt;br /&gt;Sure, out of the box Sharepoint workflows are primitive. Sharepoint Designer adds a lot of flexibility though and there are business people out there that do amazing things with Sharepoint Designer workflows. Of course, the real power comes from custom development with Visual Studio. Here again, Sharepoint provides hosting and persistence services for the workflow.&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;Ultimately, Sharepoint is built on top of ASP.Net. It can be thought of as greatly enriched ASP.Net. Therefore everything that’s possible in ASP.Net is still possible in Sharepoint. But Sharepoint provides a lot of functionality that can and should be reused. In addition, especially in 2010 release, this functionality is probably better tested and documented than most custom ASP.Net applications out there. &lt;br /&gt;&lt;br /&gt;Sharepoint provides richer framework for developers, well known environment for system administrators, consistent UI and certain independence from IT to the end users. There are border cases when it probably would not be the best technology to choose, e.g. MSN or Bing web sites or “productized” applications. But for most intranet solutions it definitely could provide significant savings on development, training and maintenance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5404298535578768913?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5404298535578768913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/why-i-like-developing-with-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5404298535578768913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5404298535578768913'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/why-i-like-developing-with-sharepoint.html' title='Why I like developing with Sharepoint'/><author><name>val</name><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-4420197003505233862.post-3191006776402713818</id><published>2010-11-17T13:57:00.003-05:00</published><updated>2011-01-10T15:53:50.436-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='WSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>The simplest DDF possible</title><content type='html'>.OPTION EXPLICIT&lt;br /&gt;.Set CabinetNameTemplate=my.cab  &lt;br /&gt;.set DiskDirectoryTemplate=&lt;br /&gt;.Set CompressionType=MSZIP&lt;br /&gt;.Set UniqueFiles="OFF"&lt;br /&gt;.Set Cabinet=on&lt;br /&gt;myfile.xml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3191006776402713818?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3191006776402713818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/simplest-ddf-possible.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3191006776402713818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3191006776402713818'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/simplest-ddf-possible.html' title='The simplest DDF possible'/><author><name>val</name><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-4420197003505233862.post-2352464345961666599</id><published>2010-11-15T14:45:00.006-05:00</published><updated>2011-01-10T15:54:48.773-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint Upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Migrate standalone Sharepoint 2007 to 2010 farm</title><content type='html'>Only database attach upgrade is supported in this scenario because the type of install is changed: standalone vs farm.&lt;br /&gt;&lt;br /&gt;First, remove the database in Central Administration/Application Management/Content Databases.&lt;br /&gt;&lt;br /&gt;Detach the database from SQL Server Express. Now I don't have any SQL Server 2005 management tools installed, so I got to do without them:&lt;br /&gt;- Open the command prompt, cd to C:\Program Files\Microsoft SQL Server\90\Tools\Binn&lt;br /&gt;- While logged in under windows account that has admin rights on the SQL Server run &lt;br /&gt;&lt;pre&gt;osql -S (local)\OfficeServers -E&lt;/pre&gt;- In the SQL console run (substitute the correct database name)&lt;br /&gt;&lt;pre&gt;exec sp_detach_db 'WSS_Content'&lt;/pre&gt;- Don't forget the 'go'&lt;br /&gt;- Now the database is just two files, WSS_Content.mdf and WSS_Content.ldf. Copy them over to the farm's SQL Server. There (hopefully) you'll have management tools so use them to attach the database. Otherwise the command is along the lines of&lt;br /&gt;&lt;pre&gt;1&amp;gt; exec sp_attach_db 'WSS_Content','C:\Program Files\Microsoft SQL Server\&lt;br /&gt;MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WSS_Content.mdf',&lt;br /&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WSS_Content_log.ldf'&lt;br /&gt;2&amp;gt; go&lt;/pre&gt;&lt;br /&gt;Add the database in 2010's Central Administration/Application Management/Manage Content Databases or mount it in PowerShell:&lt;br /&gt;&lt;pre&gt;Mount-SPContentDatabase WSS_Content -WebApplication http://url&lt;/pre&gt;&lt;br /&gt;BTW, 2003 to 2007 migration is exactly the same.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2352464345961666599?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2352464345961666599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/migrate-standalone-sharepoint-2007-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2352464345961666599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2352464345961666599'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/migrate-standalone-sharepoint-2007-to.html' title='Migrate standalone Sharepoint 2007 to 2010 farm'/><author><name>val</name><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-4420197003505233862.post-2607777579501599092</id><published>2010-11-10T13:48:00.001-05:00</published><updated>2010-11-10T13:49:09.284-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><title type='text'>Poor man's web service</title><content type='html'>When you just need to emulate a web service for testing or similar scenario, you don't really need a fancy WCF or even ASMX. Just capture the responses of the web service you are emulating and use a plain ASPX:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;%@ Page Language="C#" Debug="true" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="System.IO" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script runat="server"&amp;gt;&lt;br /&gt;&lt;br /&gt;    protected override void  Render(HtmlTextWriter writer)&lt;br /&gt;    {&lt;br /&gt;        if (Request.QueryString.Keys.Count &amp;gt; 0 &amp;&amp;&lt;br /&gt;            Request.QueryString[0].Equals("wsdl", StringComparison.InvariantCultureIgnoreCase))&lt;br /&gt;        {&lt;br /&gt;            string path = Server.MapPath(".");&lt;br /&gt;            using (StreamReader reader = new StreamReader(Path.Combine(path, "my.wsdl")))&lt;br /&gt;            {&lt;br /&gt;                Response.Write(reader.ReadToEnd());&lt;br /&gt;            }&lt;br /&gt;            Response.AppendHeader("Content-Type", "text/xml;charset=utf-16");&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            string filename = string.Empty;&lt;br /&gt;            if (Request.Headers["SOAPAction"] == "\"myAction1\"")&lt;br /&gt;            {&lt;br /&gt;                filename = "response1.xml";&lt;br /&gt;            }&lt;br /&gt;                        &lt;br /&gt;            if (!String.IsNullOrEmpty(filename))&lt;br /&gt;            {&lt;br /&gt;                string path = Server.MapPath(".");&lt;br /&gt;                using (StreamReader reader = new StreamReader(Path.Combine(path, filename)))&lt;br /&gt;                {&lt;br /&gt;                    Response.Write(reader.ReadToEnd());&lt;br /&gt;                }&lt;br /&gt;                Response.AppendHeader("Content-Type", "text/xml; charset=utf-8");&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2607777579501599092?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2607777579501599092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/poor-mans-web-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2607777579501599092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2607777579501599092'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/poor-mans-web-service.html' title='Poor man&apos;s web service'/><author><name>val</name><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-4420197003505233862.post-7284475470584950844</id><published>2010-11-08T16:50:00.003-05:00</published><updated>2010-11-10T14:04:06.345-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Services'/><title type='text'>Consuming RPC/Encoded web services in .Net</title><content type='html'>I am working with a client to help them create a web service in PHP which would be consumed by the BDC. Eventually we got to the point when WSDL looks good and the web service responds as specified in the WSDL. However, both Application Defintion Editor and WebService Studio could not consume the web service. I tweaked it to no avail. The errors I got were along the lines of&lt;br /&gt;- InvalidCastException: Cannot convert MyType to MyType[]&lt;br /&gt;- InvalidOperationException: There's an error in XML at (xx,yy)&lt;br /&gt;and the like. &lt;br /&gt;Ultimately, it turned out that the WSDL we have used RPC/Encoded style. Here's the &lt;a href="http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/"&gt;description&lt;/a&gt; of what it is. But per the &lt;a href="http://www.ws-i.org/Profiles/BasicProfile-1.1.html"&gt;WS-I Basic Profile Version 1.1&lt;/a&gt; specification, only RPC/literal or Document/literal should be used. So .Net is somewhat justified in not being able to deal with RPC/Encoded automatically. Thus the only way to consume RPC/Encoded web service is to tweak the generated proxy code (or write it from scratch). In my case that was not the option because the service is consumed by BDC. Therefore we changed the WSDL to Document/Literal style. &lt;br /&gt;&lt;br /&gt;In fact, the WS-I specification needs to be followed. E.g. It requires message parts to use "element" rather than "type" and automatic proxy generation code in .Net seem to simply ignore the parts declared using "type" attribute in Document/Literal style. &lt;br /&gt;&lt;span style="display: none"&gt;AXIS web services, consuming java web services from .net problem&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7284475470584950844?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7284475470584950844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/consuming-rpcencoded-web-services-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7284475470584950844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7284475470584950844'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/consuming-rpcencoded-web-services-in.html' title='Consuming RPC/Encoded web services in .Net'/><author><name>val</name><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-4420197003505233862.post-8274637730778330326</id><published>2010-11-05T11:55:00.000-04:00</published><updated>2010-11-05T11:55:12.660-04:00</updated><title type='text'>Weird WSDL error</title><content type='html'>&lt;pre&gt;System.ArgumentException: Cannot find definition for http://schemas.xmlsoap.org/wsdl/:MyBinding.  &lt;br /&gt;Service Description with namespace http://schemas.xmlsoap.org/wsdl/ is missing.&lt;br /&gt;Parameter name: name&lt;br /&gt;   at System.Web.Services.Description.ServiceDescriptionCollection.GetServiceDescription(&lt;br /&gt;XmlQualifiedName name)&lt;br /&gt;   at System.Web.Services.Description.ServiceDescriptionCollection.GetBinding(&lt;br /&gt;XmlQualifiedName name)&lt;br /&gt;   at System.Web.Services.Description.ProtocolImporter.GenerateCode(&lt;br /&gt;CodeNamespace codeNamespace, ImportContext importContext, Hashtable exportContext)&lt;br /&gt;   at System.Web.Services.Description.ServiceDescriptionImporter.Import(&lt;br /&gt;CodeNamespace codeNamespace, ImportContext importContext, &lt;br /&gt;Hashtable exportContext, StringCollection warnings)&lt;br /&gt;   at System.Web.Services.Description.ServiceDescriptionImporter.Import(&lt;br /&gt;CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit)&lt;br /&gt;&lt;/pre&gt;The WSDL had a &amp;lt;service&amp;gt; element like this&lt;br /&gt;&amp;lt;service name='MyService'&amp;gt;&lt;br /&gt;&amp;lt;port name='MyPort' binding='MyBinding'&amp;gt;&lt;br /&gt;&lt;br /&gt;But what it should have been is &lt;br /&gt;&amp;lt;port name='MyPort' binding='&lt;span style="font-weight:bold;text-decoration:underline;"&gt;tns:&lt;/span&gt;MyBinding'&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8274637730778330326?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8274637730778330326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/11/weird-wsdl-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8274637730778330326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8274637730778330326'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/11/weird-wsdl-error.html' title='Weird WSDL error'/><author><name>val</name><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-4420197003505233862.post-1268095431804056169</id><published>2010-10-21T14:40:00.000-04:00</published><updated>2010-10-21T14:40:45.514-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Detach Sharepoint list from its feature</title><content type='html'>Provisioning a list through a feature creates a bond between the list and the feature. E.g. if the list is saved as a template and then moved to another server, the other server must have the feature installed. There's really no way to detach the list from the feature, but it's possible to create exactly the same list which does not have the reference to the feature:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Save the provisioned list as a template&lt;/li&gt;&lt;li&gt;Download the template, rename it to .cab and extract manifest.xml&lt;/li&gt;&lt;li&gt;Open manifest.xml in Notepad and replace guids in two instances of the FeatureId with 00BFEA71-DE22-43B2-A848-C05709900100 and change the immediately following TemplateType/ServerTemplate elements to 100 (for generic list)&lt;/li&gt;&lt;li&gt;Save the xml, use MAKECAB to create a cab, rename the cab to .stp upload the template to the server and create the new list.&lt;/li&gt;&lt;li&gt;It's a new list. All references everywhere will have to be updated to point to it.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1268095431804056169?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1268095431804056169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/10/detach-sharepoint-list-from-its-feature.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1268095431804056169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1268095431804056169'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/10/detach-sharepoint-list-from-its-feature.html' title='Detach Sharepoint list from its feature'/><author><name>val</name><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-4420197003505233862.post-6154117705683092246</id><published>2010-10-19T14:25:00.000-04:00</published><updated>2010-10-19T14:25:53.040-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server 2008'/><title type='text'>Problem changing password on Windows Server 2008 R2 Domain Controller</title><content type='html'>This almost gave me a few more gray hairs. I changed the admin password on the DC, but then I thought the new password is not complex enough. So I attempt to change it to a more complex one and get "Unable to update the password.  The value provided for the new password does not meet the length, complexity, or history requirements of the domain". So I make sure the passwords meets them. Then I disable complexity enforcement and password history, run gpupdate, reboot the DC - still the same error. Finally I read somewhere about the Minimum Password Age policy setting, which is specifically designed to prevent too frequent password changes. By default it is set to 1 day, preventing me from changing the password twice a day. Changed it to 0 and changed my password.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-6154117705683092246?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/6154117705683092246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/10/problem-changing-password-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6154117705683092246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6154117705683092246'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/10/problem-changing-password-on-windows.html' title='Problem changing password on Windows Server 2008 R2 Domain Controller'/><author><name>val</name><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-4420197003505233862.post-5264447550859530245</id><published>2010-10-19T12:30:00.003-04:00</published><updated>2010-10-19T12:37:12.244-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DVWP'/><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='DataFormWebPart'/><title type='text'>Numeric sorting in DataViewWebPart</title><content type='html'>Apparently by default DVWP sorts everything as text. Which is not entirely what I needed for numberic columns, obviously. I found &lt;a href="http://pioneeringsharepoint.blogspot.com/2009/08/dvwp-failed-to-sort-my-columns.html"&gt;a great post&lt;/a&gt; on the subject which mentioned two ways to fix it. First, setting dvt_sorttype template parameter to "number" would make DVWP sort everything as numbers. Also we can add a parameter to GenFireServerEvent() call in the dvt.headerfield template to specify the sort mode. It seem to accept values "text" or "number" just like xsl:sort and they are case-sensitive.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;My idea was to reuse the fieldtype parameter instead of creating a new template parameter as in the post above. In my case it was enough to set fieldtype of numeric columns to "Number", which also causes the filter values drop down to be sorted numerically. Then I pass the value of it to the GenFireServerEvent(). I have to account for case sensitivity though.&lt;br /&gt;&lt;pre&gt;&amp;lt;th class="ms-vh" nowrap=""&amp;gt;&lt;br /&gt;  &amp;lt;xsl:call-template name="dvt.headerfield" ddwrt:atomic="1"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="fieldname"&amp;gt;Description&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="fieldtitle"&amp;gt;Description&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="displayname"&amp;gt;Description&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="sortable"&amp;gt;1&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &lt;span style="background-color:Yellow"&gt;&amp;lt;xsl:with-param name="fieldtype"&amp;gt;Text&amp;lt;/xsl:with-param&amp;gt;&lt;/span&gt;&lt;br /&gt;  &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th class="ms-vh" nowrap=""&amp;gt;&lt;br /&gt;  &amp;lt;xsl:call-template name="dvt.headerfield" ddwrt:atomic="1"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="fieldname"&amp;gt;Quantity&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="fieldtitle"&amp;gt;Quantity&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="displayname"&amp;gt;Quantity&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;xsl:with-param name="sortable"&amp;gt;1&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &lt;span style="background-color:Yellow"&gt;&amp;lt;xsl:with-param name="fieldtype"&amp;gt;Number&amp;lt;/xsl:with-param&amp;gt;&lt;/span&gt;&lt;br /&gt;  &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&amp;lt;/th&amp;gt;&lt;br /&gt;......&lt;br /&gt;&amp;lt;xsl:template name="dvt.headerfield"&amp;gt;&lt;br /&gt; ......&lt;br /&gt;    &amp;lt;xsl:attribute name="href"&amp;gt;&lt;br /&gt;      javascript: &amp;lt;xsl:value-of select="ddwrt:GenFireServerEvent(&lt;br /&gt;           concat('dvt_sortfield={',$sortfield,'};dvt_sortdir={',$sortText,&lt;br /&gt;           &lt;span style="background-color:Yellow"&gt;'};dvt_sorttype={',translate($fieldtype,'NT','nt'),'}'&lt;/span&gt;))" /&amp;gt;;&lt;br /&gt;    &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;    &amp;lt;xsl:attribute name="onclick"&amp;gt;&lt;br /&gt;      javascript: &amp;lt;xsl:value-of select=&amp;quot;ddwrt:GenFireServerEvent(&lt;br /&gt;           concat('dvt_sortfield={',$sortfield,'};dvt_sortdir={',$sortText,&lt;br /&gt;           &lt;span style="background-color:Yellow"&gt;'};dvt_sorttype={',translate($fieldtype,'NT','nt'),'}'&lt;/span&gt;))&amp;quot; /&amp;gt;;&lt;br /&gt;    &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;    .......&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5264447550859530245?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5264447550859530245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/10/numeric-sorting-in-dataviewwebpart.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5264447550859530245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5264447550859530245'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/10/numeric-sorting-in-dataviewwebpart.html' title='Numeric sorting in DataViewWebPart'/><author><name>val</name><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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-1922850046005353508</id><published>2010-10-17T22:36:00.005-04:00</published><updated>2010-12-28T12:44:09.541-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DVWP'/><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Using Linked Data Sources, Web Services and custom Data Sources with DataViewWebPart</title><content type='html'>&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Requirement&lt;/span&gt;&lt;br /&gt;I had a requirement recently to display a joined data set with part of the data coming from a web service and part of it coming from a Sharepoint list. The first approach that comes to mind of a Sharepoint developer is to use a DVWP with a linked data source. This is a very powerful technique but still has a few disadvantages, namely, standard sorting and filtering will not work. On the other hand, the first approach that comes to mind of an ASP.Net developer is to write code that joins the data in a common data set and then bind it to the DVWP somehow. It is, naturally, a more complicated approach but it allows to use DVWP sorting and filtering OOB. &lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Environment&lt;/span&gt;&lt;br /&gt;For examples in this article I will use a simple Sharepoint list called “DVWP Join Demo” with two columns: Title (text) and WebServiceItemID (number). The web service will be the following ASMX web service:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;System.Collections.Generic;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;System.Web.Services;&lt;br /&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;System;&lt;br /&gt; &lt;br /&gt;[&lt;span style="color: #2b91af;"&gt;WebService&lt;/span&gt;(Namespace&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"http://tempuri.org/"&lt;/span&gt;)]&lt;br /&gt;[&lt;span style="color: #2b91af;"&gt;WebServiceBinding&lt;/span&gt;(ConformsTo&amp;nbsp;=&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WsiProfiles&lt;/span&gt;.BasicProfile1_1)]&lt;br /&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WebService&lt;/span&gt;&amp;nbsp;:&amp;nbsp;System.Web.Services.&lt;span style="color: #2b91af;"&gt;WebService&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;WebMethod&lt;/span&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;WebServiceDataItem&lt;/span&gt;&amp;gt;&amp;nbsp;GetWebServiceData()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;WebServiceDataItem&lt;/span&gt;&amp;gt;&amp;nbsp;list&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;WebServiceDataItem&lt;/span&gt;&amp;gt;();&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;&amp;nbsp;rnd&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Random&lt;/span&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;nbsp;i&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;i&amp;nbsp;&amp;lt;&amp;nbsp;100;&amp;nbsp;i++)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Add(&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WebServiceDataItem&lt;/span&gt;()&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;ID&amp;nbsp;=&amp;nbsp;i,&amp;nbsp;Description&amp;nbsp;=&amp;nbsp;rnd.Next().ToString()&amp;nbsp;});&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;list;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WebServiceDataItem&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;nbsp;ID&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;/span&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;/span&gt;;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;Description&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;/span&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;/span&gt;;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/pre&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Using Sharepoint Designer and Linked Datasources&lt;/span&gt;&lt;br /&gt;This approach is explained very well &lt;a href="http://office.microsoft.com/en-ca/sharepoint-designer-help/display-data-from-multiple-sources-in-a-single-data-view-HA010099144.aspx?CTT=5&amp;amp;origin=HA010115404"&gt;here&lt;/a&gt;. &lt;br /&gt;Basically, open SPD and:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Open Datasource Library task pane&lt;/li&gt;&lt;li&gt;Create a web service data source&lt;/li&gt;&lt;li&gt;Create a linked data with the web service datasource and the sharepoint list. On the first dialog of the wizard select the web service and the list you want to use. On the second dialog check that you want a joined dataset. You can think of this step as creating a combined XML document of both datasources. It will have the following structure:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9173_HUvI4c/TLurZoXDcSI/AAAAAAAAARs/IRhgoPQlRZY/s1600/DVWP+Join+Demo+Linked.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_9173_HUvI4c/TLurZoXDcSI/AAAAAAAAARs/IRhgoPQlRZY/s1600/DVWP+Join+Demo+Linked.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;Note that SPD did not prompt for the join condition. Therefore no “joining” was performed yet. Also note that by default it fetches all columns from the list, including unnecessary ones. That can be changed in the DataSource Properties dialog.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now, open an ASPX page in the Designer and select Data View/Insert Data View from the menu. &lt;/li&gt;&lt;li&gt;Then find the linked data source you just created in the data source library, click on it and select “Show Data”. Select the items from the web service data you want and click Insert Selected Fields as Multiple Items View. For the demo, I select ID and Description fields as shown on the screenshot above.&lt;/li&gt;&lt;li&gt;Look at the XSL it generated. E.g. the template for data cells is &lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ms-vb"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;xsl&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;value-of&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"format-number(ddw1:ID,&amp;nbsp;'#,##0.#;-#,##0.#')"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ms-vb"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;xsl&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;value-of&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ddw1:Description"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;Note the ddw1 namespace. It is defined in the xsl declaration &amp;lt;xsl:stylesheet …  xmlns:ddw1="http://tempuri.org/" ...&amp;gt; It is the namespace defined in the web service in the WebService attribute. Its presence here means that all XML elements of the web service response belong to this namespace. Thus in the xsl, for example, the Description element must be referenced as ddw1:Description. Make a mental note of that.&lt;/li&gt;&lt;li&gt;Add a column on the right of the description column. Then put the cursor in the body cell of the new column, i.e. not in the first or header cell, but in the second or below cell. Now in the Data Source Details Task Pane select the Title element of the Sharepoint list data. Then from the “Inset Selected Field as” menu choose Formatted/Joined Item. Now the Designer will prompt to select the fields to join on. Select ddw1:ID and WebServiceItemID fields. (I was confused by the Join Subview dialog at first because it looks like you need to select fields by moving them from one list to another. But you just need to select one field in each list.)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/TLusZGyGWUI/AAAAAAAAARw/SBTeGmTOdgQ/s1600/DVWP+Join+Demo+Linked+DVWP.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9173_HUvI4c/TLusZGyGWUI/AAAAAAAAARw/SBTeGmTOdgQ/s1600/DVWP+Join+Demo+Linked+DVWP.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Look at the xsl:&lt;br /&gt;&lt;span style="font: 100% Georgia,Serif;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ms-vb"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;xsl&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;value-of&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"../../../../../../DVWP_Join_Demo/Rows/Row[@WebServiceItemID=current()/ddw1:ID]/@Title"&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;So that’s how it joins the data! It simply runs an XPath query to get the matching row. That means we can “join” the same data any way we like that XPath supports, e.g. I can have another column like this&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"ms-vb"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;xsl&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: maroon;"&gt;value-of&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;select&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"../../../../../../DVWP_Join_Demo/Rows/Row[@WebServiceItemID=current()/ddw1:ID+1]/@Title"&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;td&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;That’s it. Add some text in the header cell and we are done! That is, if all we wanted was to display the data in the grid. But neither filtering, nor sorting work.&lt;/li&gt;&lt;li&gt;In the DVWP properties, check the “Enable sorting and filtering on column headers”. Still none of the headers are sortable. Note that xsl is as follows:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;th&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;ms-vh&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;nowrap&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;""&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:call-template&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;dvt.headerfield&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;ddwrt:atomic&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;1&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;fieldname&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;ddw1:Description&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;fieldtitle&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Description&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;displayname&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Description&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="font-weight: bold; text-decoration: underline;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;sortable&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;0&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;name&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;fieldtype&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;Text&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:with-param&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xsl:call-template&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;th&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;Changing “sortable” parameter to 1 will enable the hyperlink and the dropdown menu in the header, but neither sorting nor filtering still will not work. &lt;/li&gt;&lt;li&gt;Enabling the tool bar in the DVWP properties will bring up the toolbar with options for sorting and filtering. The filtering will work but sorting still does not. To me the toolbar is somewhat awkward anyway. &lt;/li&gt;&lt;/ul&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Xml File Datasource&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I made a simple experiment then. I created a DataSet object, populated it with some data and saved it to an XML file using SaveXml method. I then uploaded the file to a document library after which it automatically appeared under Xml File Datasources category in the Datasource Library. I then created a DVWP based on this datasource. Both sorting and filtering worked as usual. So I thought that I might get it to work if I implement my own data source which would give me complete control over the XML being used.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Using the code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;All right, the SPD is very powerful but not enough for my purposes. Let’s code. &lt;br /&gt;I tried multiple approaches but the one that ultimately worked for me is to create a class derived from BaseXmlDataSource and return the XML of the data I want to use in the overridden FetchData method. Here’s the skeleton class&lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;MyXmlDataSource&lt;/span&gt;&amp;nbsp;:&amp;nbsp;&lt;span style="color: #2b91af;"&gt;BaseXmlDataSource&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;override&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;FetchData(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;requestUrl)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;//return&amp;nbsp;XML&amp;nbsp;here&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: #a31515;"&gt;""&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;override&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;HierarchicalDataSourceView&lt;/span&gt;&amp;nbsp;GetHierarchicalView(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;viewPath)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Now the first problem I had to solve is how to get the raw XML from the web service. The thing is that normally .Net completely hides it and makes you operate on classes and proxy objects. Which is great most of the time but now I needed the raw XML. For simplicity the code I used simply makes a POST request to the web service without using SOAP at all. Therefore the XML it returns is simpler than the XML SPD uses. &lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;protected&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;override&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;FetchData(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;requestUrl)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;HttpWebRequest&lt;/span&gt;&amp;nbsp;req&amp;nbsp;=&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;HttpWebRequest&lt;/span&gt;.Create(&lt;span style="color: #a31515;"&gt;"http://localhost:82/WebService.asmx/GetWebServiceData"&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;as&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;HttpWebRequest&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.Method&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"POST"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.ContentType&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"application/x-www-form-urlencoded"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.ContentLength&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;WebResponse&lt;/span&gt;&amp;nbsp;resp&amp;nbsp;=&amp;nbsp;req.GetResponse();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;str;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;Stream&lt;/span&gt;&amp;nbsp;s&amp;nbsp;=&amp;nbsp;resp.GetResponseStream())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;StreamReader&lt;/span&gt;&amp;nbsp;reader&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;StreamReader&lt;/span&gt;(s))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;str&amp;nbsp;=&amp;nbsp;reader.ReadToEnd();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;str;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;This is the XML it will return:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515;"&gt;xml&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;version&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;1.0&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;encoding&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ArrayOfWebServiceDataItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:xsi&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;xmlns:xsd&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://tempuri.org/&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;WebServiceDataItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;0&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Description&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;1441713228&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Description&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;WebServiceDataItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;WebServiceDataItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;1&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Description&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;208776861&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Description&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;WebServiceDataItem&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;etc&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Open a new ASPX in the Designer&lt;/li&gt;&lt;li&gt;Register the assembly that contains your data source class at the top of the page:&lt;br /&gt;&lt;pre&gt;&lt;span style="background: none repeat scroll 0% 0% yellow;"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue;"&gt;@&lt;/span&gt;&amp;nbsp;&lt;span style="color: maroon;"&gt;Register&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;TagPrefix&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"my"&lt;/span&gt;&amp;nbsp;&lt;span style="color: red;"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"mynamespace"&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color: red;"&gt;Assembly&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: blue;"&gt;"My,&amp;nbsp;Version=1.0.0.0,&amp;nbsp;Culture=neutral,&amp;nbsp;PublicKeyToken=token"&lt;/span&gt;&amp;nbsp;&lt;span style="background: none repeat scroll 0% 0% yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Insert the DVWP as usual but then just go to the code view and add your data source to the DataSources collection:&lt;br /&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DataSources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;my:MyXmlDataSource&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;ID&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;MyXmlDataSource1&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;runat&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;server&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DataSources&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;After making this change click on the preview pane to refresh it and then click on the “Now insert fields to create a view” link. Note that it actually displays the data from your data source in the Datasource Details pane and you can use the Designer to format the DVWP. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Unfortunately, sorting and filtering still do not work. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;That did not make any sense to me because the XML my data source returns is just like the one generated by the DataSet class but sorting and filtering worked with that XML yet it does not work with mine. Then I noticed the  xmlns=http://tempuri.org/ attribute in my XML. Once I removed it, sorting and filtering worked as usual. Which was followed by a loud "Yes!!!".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Looking at the xsl now the only difference I see is that ddw1 namespace and all references to it are now gone. My guess is the namespace somehow interferes with DVWP code but I am too lazy to dig it up in Reflector.&lt;/li&gt;&lt;li&gt;One sad thing is that you can't create a linked datasource with this custom datasource. The AggregateDataSource class that handles linked datasources throws an exception when I try. Therefore loading the Sharepoint list data and merging it with the web service's dataset has to be done in the code. I think it's straightforward enough though.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now I can bind DVWP to ANYTHING. And it is as simple as creating a class with a single method which returns “ANYTHING” as XML string. I’d say über cool :-)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Update&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Apparently it does not always work. Sometimes after "Insert selected as Multiple Item View" SPD either crashes or converts the DataFormWebPart to DataViewWebPart and messes it up. Sometimes it works though and I cannot yet figure out what's the difference.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #365f91; font-size: larger; font-weight: bold;"&gt;Update&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;TO prevent SPD from crashing here make sure it runs on a single CPU by setting its process' affinity in the Task Manager&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1922850046005353508?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1922850046005353508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/10/using-linked-data-sources-web-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1922850046005353508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1922850046005353508'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/10/using-linked-data-sources-web-services.html' title='Using Linked Data Sources, Web Services and custom Data Sources with DataViewWebPart'/><author><name>val</name><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/_9173_HUvI4c/TLurZoXDcSI/AAAAAAAAARs/IRhgoPQlRZY/s72-c/DVWP+Join+Demo+Linked.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-1214939475412350806</id><published>2010-10-05T18:09:00.003-04:00</published><updated>2010-10-19T12:42:46.774-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DVWP'/><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='DataFormWebPart'/><title type='text'>XSLT template for summing values skipping NaNs</title><content type='html'>How to show column totals in DVWP? The obvious approach is to put something like&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:value-of select=&amp;quot;sum($nodeset/@MyField)&amp;quot;/&amp;gt;&lt;/pre&gt;in e.g. group footer table row. The problem though is that if one of the values coming from the list is empty, then it will be treated as NaN making the whole sum NaN. So, following &lt;a href="http://www.biglist.com/lists/xsl-list/archives/200111/msg00768.html"&gt;this post&lt;/a&gt;, here's a recursive template that works around that:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:template name=&amp;quot;sumNaN&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;xsl:param name=&amp;quot;values&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;xsl:param name=&amp;quot;subtotal&amp;quot; select=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;    &amp;lt;xsl:when test=&amp;quot;$values&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;xsl:when test=&amp;quot;number($values)&amp;quot;&amp;gt; &amp;lt!-- see note --&amp;gt;&lt;br /&gt;          &amp;lt;xsl:call-template name=&amp;quot;sumNaN&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name=&amp;quot;values&amp;quot;&lt;br /&gt;                    select=&amp;quot;$values[position() &amp;gt; 1]&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name=&amp;quot;subtotal&amp;quot;&lt;br /&gt;                    select=&amp;quot;$subtotal + $values[1]&amp;quot; /&amp;gt;&lt;br /&gt;          &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;          &amp;lt;xsl:call-template name=&amp;quot;sumNaN&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name=&amp;quot;values&amp;quot;&lt;br /&gt;                    select=&amp;quot;$values[position() &amp;gt; 1]&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name=&amp;quot;subtotal&amp;quot;&lt;br /&gt;                    select=&amp;quot;$subtotal&amp;quot; /&amp;gt;&lt;br /&gt;          &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;    &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;      &amp;lt;xsl:value-of select=&amp;quot;$subtotal&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;/pre&gt;Can be called from DVWP XSL like this&lt;br /&gt;&lt;pre&gt;&amp;lt;xsl:call-template name=&amp;quot;sumNaN&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;xsl:with-param name=&amp;quot;values&amp;quot; select=&amp;quot;$nodeset/@MyField&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&lt;/pre&gt;Note: the test="number($values)" above is equivalent to test="number($values[position()=1]) because &lt;a href="http://www.w3.org/TR/xpath/#function-number"&gt;number()&lt;/a&gt; first converts nodeset to a string using &lt;a href="http://www.w3.org/TR/xpath/#function-string"&gt;string()&lt;/a&gt; which returns the string value of the first node of the nodeset.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1214939475412350806?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1214939475412350806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/10/xslt-template-for-summing-values.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1214939475412350806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1214939475412350806'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/10/xslt-template-for-summing-values.html' title='XSLT template for summing values skipping NaNs'/><author><name>val</name><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-4420197003505233862.post-4814855010154712665</id><published>2010-09-30T12:08:00.001-04:00</published><updated>2010-09-30T12:10:24.234-04:00</updated><title type='text'>VPN through RAS setup on Windows Server 2008 R2</title><content type='html'>- Setup DHCP server, in the server options specify DNS servers &lt;br /&gt;- In the Active Directory set up subnet (not sure it is needed)&lt;br /&gt;- Install BOTH RAS and Routing&lt;br /&gt;- In RAS properties leave default to obtain IPs from DHCP&lt;br /&gt;- In the DHCP Relay Agent properties specify the IP of the interface bound to DHCP and add Internal interface&lt;br /&gt;- Make sure your user belongs to a group that's allowed to connect remotely as specified in the NPS&lt;br /&gt;- On the client make sure to uncheck "Use default gateway" option in the Neworking properties of the connection&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4814855010154712665?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4814855010154712665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/vpn-through-rras-setup-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4814855010154712665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4814855010154712665'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/vpn-through-rras-setup-on-windows.html' title='VPN through RAS setup on Windows Server 2008 R2'/><author><name>val</name><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-4420197003505233862.post-4747288140457996754</id><published>2010-09-23T20:07:00.002-04:00</published><updated>2010-10-19T12:42:14.612-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom Fields'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>How to make fields in Sharepoint list read only depending on group membership</title><content type='html'>I needed to make some fields in a Sharepoint list editable only by members of one group and other fields editable only by members of another group. Sharepoint, unfortunately, does not have field level security, but here's an outline of how it can be done.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Create a custom field type. Make sure to specify a base type and set AllowBaseTypeRendering to TRUE:&lt;br /&gt;&lt;pre&gt;&amp;lt;FieldType&amp;gt;&lt;br /&gt;    &amp;lt;Field Name=&amp;quot;TypeName&amp;quot;&amp;gt;MyField&amp;lt;/Field&amp;gt;&lt;br /&gt;    &lt;b&gt;&amp;lt;Field Name=&amp;quot;ParentType&amp;quot;&amp;gt;Text&amp;lt;/Field&amp;gt;&lt;/b&gt;&lt;br /&gt;    &lt;b&gt;&amp;lt;Field Name=&amp;quot;AllowBaseTypeRendering&amp;quot;&amp;gt;TRUE&amp;lt;/Field&amp;gt;&lt;/b&gt;&lt;br /&gt;    &amp;lt;Field Name=&amp;quot;FieldTypeClass&amp;quot;&amp;gt;MyField, MyAssembly&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;lt;/FieldType&amp;gt;&lt;br /&gt;&lt;/pre&gt;In the list template explicitly set ReadOnly to FALSE:&lt;br /&gt;&lt;pre&gt;&amp;lt;List ... &amp;gt;&lt;br /&gt;  &amp;lt;MetaData&amp;gt;&lt;br /&gt;    ...&lt;br /&gt;    &amp;lt;Fields&amp;gt;&lt;br /&gt;      &amp;lt;Field Type=&amp;quot;MyField&amp;quot; &lt;b&gt;ReadOnly=&amp;quot;FALSE&amp;quot;&lt;/b&gt; ... /&amp;gt;&lt;br /&gt;    &amp;lt;/Fields&amp;gt;&lt;br /&gt;    ...&lt;br /&gt;  &amp;lt;/Metadata&amp;gt;&lt;br /&gt;&amp;lt;/List&amp;gt;  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the class implementing the field add a new method, e.g. MakeReadOnlyByGroup() and call it from both constructors. Note that SPContext might be null during feature activation.&lt;br /&gt;&lt;pre&gt;public class MyField : SPFieldText&lt;br /&gt;{&lt;br /&gt;    private void MakeReadOnlyByGroup()&lt;br /&gt;    {&lt;br /&gt;        if (SPContext.Current == null) return;&lt;br /&gt;        //implement whatever logic to set ReadOnly property&lt;br /&gt;    }&lt;br /&gt;    public MyField(SPFieldCollection fields, string fieldName)&lt;br /&gt;        : base(fields, fieldName) &lt;br /&gt;    {&lt;br /&gt;        MakeReadOnlyByGroup();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public MyField(SPFieldCollection fields, string typeName, string displayName)&lt;br /&gt;        : base(fields, typeName, displayName) &lt;br /&gt;    {&lt;br /&gt;        MakeReadOnlyByGroup();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It works in both normal edit form and in datasheet mode. In datasheet mode the value can be modified, i.e. the cell is not read only, but it will revert back to the original once focus leaves the row.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4747288140457996754?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4747288140457996754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-make-fields-in-sharepoint-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4747288140457996754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4747288140457996754'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-make-fields-in-sharepoint-list.html' title='How to make fields in Sharepoint list read only depending on group membership'/><author><name>val</name><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-4420197003505233862.post-7435333891968663087</id><published>2010-09-17T10:37:00.007-04:00</published><updated>2010-09-27T22:45:10.169-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='DVWP'/><category scheme='http://www.blogger.com/atom/ns#' term='DataViewWebPart'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>How to filter Data View WebPart from a DropDownList</title><content type='html'>The problem: to have a drop down list on the page which provides a filter value for the data displayed in the DVWP.&lt;br /&gt;&lt;br /&gt;First, web part connection do not work because there's no way to clear the filter. Looking at the DVWP code in the Reflector makes it obvious that the filter is never cleared no matter what value is returned from the connection provider.&lt;br /&gt;&lt;br /&gt;However, the drop down menu on the DVWP column header has an option "Clear filter" which simply posts back a special value. &lt;br /&gt;&lt;br /&gt;So, for example&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:DropDownList ID="lstFilter" AutoPostBack="false" ... /&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ClientOnClick="filter_click();" ... /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;function filter_click()&lt;br /&gt;{&lt;br /&gt;   //full web part id&lt;br /&gt;   var dvwpid="ctl00$m$g_guid";&lt;br /&gt;   //DVWP field name, @+the last part of field's XPath &lt;br /&gt;   var filter_field="@My_x0020_Filter";&lt;br /&gt;   var elt=document.getElementById("lstFilter");&lt;br /&gt;   var filter=elt.options[elt.selectedIndex].text;&lt;br /&gt;       &lt;br /&gt;   if(filter=="")&lt;br /&gt;   {&lt;br /&gt;       //clear the filter&lt;br /&gt;       __doPostBack(dvwpid,'NotUTF8;__filter={'+filter_field+'=##dvt_all##}');&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;       __doPostBack(dvwpid,'NotUTF8;__filter={'+filter_field+'='+filter+'}');&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Works in MOSS 2007 SP2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7435333891968663087?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7435333891968663087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-filter-data-view-web-part-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7435333891968663087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7435333891968663087'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-filter-data-view-web-part-from.html' title='How to filter Data View WebPart from a DropDownList'/><author><name>val</name><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-4420197003505233862.post-7917016531681069494</id><published>2010-09-14T12:49:00.000-04:00</published><updated>2010-09-14T12:49:06.229-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>Provisioning web part pages using a feature</title><content type='html'>I was thinking about provisioning standard web part pages from STS definition using &amp;lt;Module&amp;gt;/&amp;lt;File&amp;gt;/&amp;lt;AllUsersWebPart&amp;gt; element in a feature. Not in a site definition, but in a feature that should be activated on a site. The drawbacks turn out to be that since the page is not removed automatically when the feature is deactivated, reactivating the feature adds the same web parts to the same page for the second time. Also, it does not seem possible to connect web parts in CAML, it can only be &lt;a href="http://blogs.msdn.com/b/edhild/archive/2007/04/17/how-to-connect-web-parts-during-site-provisioning.aspx"&gt;done in the receiver code&lt;/a&gt;. Thus it appears that the only feasible approach is to customize the page in the designer and then carry it as a file with the feature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7917016531681069494?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7917016531681069494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/provisioning-web-part-pages-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7917016531681069494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7917016531681069494'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/provisioning-web-part-pages-using.html' title='Provisioning web part pages using a feature'/><author><name>val</name><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-4420197003505233862.post-2939425749439967124</id><published>2010-09-14T11:45:00.001-04:00</published><updated>2010-09-14T11:46:09.077-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>How to provision a web part page from team site definition using a feature</title><content type='html'>Obviously you can create a copy of one of the pages in TEMPLATE\1033\STS\DOCTEMP\SMARTPGS and carry it around with your feature. (Btw, here's a &lt;a href="http://www.heathersolomon.com/blog/articles/159.aspx"&gt;description&lt;/a&gt; of which of those pages is which). Or you can create a module like this:&lt;br /&gt;&lt;br /&gt;&amp;lt;Module &lt;b&gt;SetupPath="1033\STS\DOCTEMP\SMARTPGS"&lt;/b&gt; Url="My Document Library"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;File Name="NewDocument.aspx" Url="spstd2.aspx" Type="GhostableInLibrary" &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;AllUsersWebPart WebPartZoneID="LeftColumn" WebPartOrder="0"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;![CDATA[         &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bla-bla-bla&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]]&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/AllUsersWebPart&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/File&amp;gt;&lt;br /&gt;&amp;lt;/Module&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2939425749439967124?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2939425749439967124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-provision-web-part-page-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2939425749439967124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2939425749439967124'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/how-to-provision-web-part-page-from.html' title='How to provision a web part page from team site definition using a feature'/><author><name>val</name><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-4420197003505233862.post-7761836008970285461</id><published>2010-09-10T16:23:00.000-04:00</published><updated>2010-09-10T16:23:09.335-04:00</updated><title type='text'>Create SPList from feature</title><content type='html'>&lt;pre&gt;web.Lists.Add(&amp;quot;title&amp;quot;,&amp;quot;description&amp;quot;,&amp;quot;&lt;b&gt;Lists/folder&lt;/b&gt;/listname&amp;quot;,&lt;br /&gt;     &amp;quot;feature GUID&amp;quot;, int templateid, &amp;quot;100&amp;quot;,&lt;br /&gt;     SPListTemplate.QuickLaunchOptions.Off);&lt;br /&gt;&lt;/pre&gt;Note that there's no web URL and it must be Lists, not /Lists (will throw &amp;quot;URL contains characters that are not permitted&amp;quot;). I've no idea how to create a folder under Lists in the UI but it is certainly possible in the Designer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7761836008970285461?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7761836008970285461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/09/create-splist-from-feature.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7761836008970285461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7761836008970285461'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/09/create-splist-from-feature.html' title='Create SPList from feature'/><author><name>val</name><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-4420197003505233862.post-8132504974951123136</id><published>2010-08-29T15:05:00.045-04:00</published><updated>2011-09-21T14:13:08.123-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MCTS'/><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><title type='text'>TS: 70-541 WSS 3.0 - Application Development Exam Notes</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#ChangePermissions"&gt;Change a user's permissions to edit a list&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#AddAPhoto"&gt;Add a photo to a picture library&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#AddRecurringEvent"&gt;Add a recurring event to a calendar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#DeleteThread"&gt;Delete a thread in a discussion board&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#CopyBetweenLibs"&gt;Copy a document between document libraries&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#AttachAFile"&gt;Attach a document to a list item&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#RegisterEventReceiver"&gt;Dynamically register an event receiver&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#ListIISServers"&gt;List the IIS virtual servers on a Windows SharePoint Services server farm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#ListUserSites"&gt;List the sites available to the current user&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#CreateSite"&gt;Create a site&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#AddQuickLaunch%20"&gt;Add an item to the QuickLaunch menu&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#ModifyTopNav"&gt;Modify an item on the top navigation menu&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#CreateGroup"&gt;Create a custom site group and set permissions for the group&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#AddCrossSiteGroup"&gt;Add a cross-site group to a site group on different site&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#EnableRecords"&gt;Enable the records repository for the Send to menu&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;h3 id="ChangePermissions"&gt;Change a user's permissions to edit a list.&lt;/h3&gt;&lt;br /&gt;- Permissions from SPBasePermissions enumeration are not assigned directly.&lt;br /&gt;- Instead, there must a be a Role defined that contains whatever combination of permissions necessary. &lt;br /&gt;- The role is defined at the Web level&lt;br /&gt;- Once defined, the role can be assigned to e.g. User for a List&lt;br /&gt;&lt;br /&gt;Permissions:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9173_HUvI4c/THqsETq7_yI/AAAAAAAAARU/eQKGNAnK4hI/s1600/SpBasePermissions.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="364" src="http://1.bp.blogspot.com/_9173_HUvI4c/THqsETq7_yI/AAAAAAAAARU/eQKGNAnK4hI/s640/SpBasePermissions.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Roles:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/THqsMe_JTwI/AAAAAAAAARc/Hh0lsZUhzQU/s1600/Roles.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="310" src="http://3.bp.blogspot.com/_9173_HUvI4c/THqsMe_JTwI/AAAAAAAAARc/Hh0lsZUhzQU/s400/Roles.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Thus the following code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPRoleDefinition&lt;/span&gt;&lt;span class="class1"&gt; drole = &lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt; &lt;span class="class4"&gt;SPRoleDefinition&lt;/span&gt;&lt;span class="class1"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;drole.Name = &lt;/span&gt;&lt;span class="class5"&gt;"MyRole"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;drole.BasePermissions |= &lt;/span&gt;&lt;span class="class4"&gt;SPBasePermissions&lt;/span&gt;&lt;span class="class1"&gt;.EditListItems;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.RoleDefinitions.Add(drole);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.Update();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="class4"&gt;SPRoleAssignment&lt;/span&gt;&lt;span class="class1"&gt; arole = &lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt; &lt;span class="class4"&gt;SPRoleAssignment&lt;/span&gt;&lt;span class="class1"&gt;(web.CurrentUser);&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="class3"&gt;//must use the object from the RoleDefinitions collection rather &lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="class3"&gt;//than the one created above&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arole.RoleDefinitionBindings.Add(web.RoleDefinitions[&lt;/span&gt;&lt;span class="class5"&gt;"MyRole"&lt;/span&gt;&lt;span class="class1"&gt;]);&lt;/span&gt;&lt;br /&gt;&lt;span class="class3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//ISecurableObject.FirstUniqueAncestor returns the object &lt;/span&gt;&lt;br /&gt;&lt;span class="class3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//we are inheriting permissions from&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.FirstUniqueAncestor.RoleAssignments.Add(arole);&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="AddAPhoto"&gt;Add a photo to a picture library&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class4"&gt;SPDocumentLibrary&lt;/span&gt;&lt;span class="class1"&gt; lib = web.Lists[&lt;/span&gt;&lt;span class="class5"&gt;"Pictures"&lt;/span&gt;&lt;span class="class1"&gt;] &lt;/span&gt;&lt;span class="class0"&gt;as&lt;/span&gt; &lt;span class="class4"&gt;SPDocumentLibrary&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class0"&gt;string&lt;/span&gt;&lt;span class="class1"&gt; path =&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class4"&gt;SPContext&lt;/span&gt;&lt;span class="class1"&gt;.Current.Site.MakeFullUrl(lib.RootFolder.ServerRelativeUrl) + &lt;/span&gt;&lt;span class="class5"&gt;"/MyPicture.jpg"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class0"&gt;using&lt;/span&gt;&lt;span class="class1"&gt; (&lt;/span&gt;&lt;span class="class4"&gt;Stream&lt;/span&gt;&lt;span class="class1"&gt; stream = &lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt; &lt;span class="class4"&gt;FileStream&lt;/span&gt;&lt;span class="class1"&gt;(&lt;/span&gt;&lt;span class="class5"&gt;"picture.jpg"&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class4"&gt;FileMode&lt;/span&gt;&lt;span class="class1"&gt;.Open))&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.Files.Add(path, stream, &lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="AddRecurringEvent"&gt;Add a recurring event to a calendar&lt;/h3&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms434156%28office.12%29.aspx"&gt;MSDN Article&lt;/a&gt; Problem is, the following code:&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPListItem&lt;/span&gt;&amp;nbsp;calEvent&amp;nbsp;=&amp;nbsp;list.Items.Add();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"Title"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Frequent&amp;nbsp;Event"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;recurrence&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"&amp;lt;recurrence&amp;gt;&amp;lt;rule&amp;gt;&amp;lt;firstDayOfWeek&amp;gt;su&amp;lt;/firstDayOfWeek&amp;gt;"&lt;/span&gt;&amp;nbsp;+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #a31515;"&gt;"&amp;lt;repeat&amp;gt;&amp;lt;daily&amp;nbsp;dayFrequency='2'/&amp;gt;&amp;lt;/repeat&amp;gt;"&lt;/span&gt;&amp;nbsp;+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #a31515;"&gt;"&amp;lt;windowEnd&amp;gt;2011-09-20T09:00:00Z&amp;lt;/windowEnd&amp;gt;&amp;lt;/rule&amp;gt;&amp;lt;/recurrence&amp;gt;"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"RecurrenceData"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;recurrence;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"EventType"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"EventDate"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;(2011,&amp;nbsp;1,&amp;nbsp;26,&amp;nbsp;8,&amp;nbsp;0,&amp;nbsp;0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"EndDate"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;(2011,&amp;nbsp;1,&amp;nbsp;26,&amp;nbsp;9,&amp;nbsp;0,&amp;nbsp;0);&lt;br /&gt;&lt;span class="class3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//this part is crucial, especially when copying calendar items&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"UID"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;System.&lt;span style="color: #2b91af;"&gt;Guid&lt;/span&gt;.NewGuid();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent[&lt;span style="color: #a31515;"&gt;"Recurrence"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;calEvent.Update();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Update();&lt;/pre&gt;&lt;br /&gt;properly adds events only from 01/26/2011 to 02/27/2011. The rest of them are not shown in Calendar view, although they are visible in All Events view. But clicking on the 03/01/2011 event produces the helpful "An unexpected error has occurred" error. &lt;br /&gt;&lt;br /&gt;To make it work, the EndDate must be changed to sometime after the last event had occurred, in this case it is enough to change it as &lt;br /&gt;&lt;pre&gt;calEvent[&lt;span style="color: #a31515;"&gt;"EndDate"&lt;/span&gt;]&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;(201&lt;b&gt;2&lt;/b&gt;,&amp;nbsp;1,&amp;nbsp;26,&amp;nbsp;9,&amp;nbsp;0,&amp;nbsp;0);&lt;/pre&gt;to make it work. Still, EndDate must be specified as its time portion is apparently used to calculate the duration of each individual event.&lt;br /&gt;&lt;br /&gt;&lt;h3 id="DeleteThread"&gt;Delete a thread in a discussion board&lt;/h3&gt;Threads are folders, so&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPListItem&lt;/span&gt;&amp;nbsp;folder&amp;nbsp;=&amp;nbsp;list.Folders[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;folder.Delete();&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="CopyBetweenLibs"&gt;Copy a document between document libraries&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPDocumentLibrary&lt;/span&gt;&amp;nbsp;lib&amp;nbsp;=&amp;nbsp;web.Lists[&lt;span style="color: #a31515;"&gt;"Pictures"&lt;/span&gt;]&amp;nbsp;&lt;span style="color: blue;"&gt;as&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPDocumentLibrary&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPDocumentLibrary&lt;/span&gt;&amp;nbsp;docs&amp;nbsp;=&amp;nbsp;web.Lists[&lt;span style="color: #a31515;"&gt;"Documents"&lt;/span&gt;]&amp;nbsp;&lt;span style="color: blue;"&gt;as&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPDocumentLibrary&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;path&amp;nbsp;=&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPContext&lt;/span&gt;.Current.Site.MakeFullUrl(docs.RootFolder.ServerRelativeUrl)&amp;nbsp;+&amp;nbsp;&lt;span style="color: #a31515;"&gt;"/MyPicture.jpg"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;Stream&lt;/span&gt;&amp;nbsp;stream&amp;nbsp;=&amp;nbsp;lib.Items[0].File.OpenBinaryStream())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.Files.Add(path,&amp;nbsp;stream,&amp;nbsp;&lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="AttachAFile"&gt;Attach a document to a list item&lt;/h3&gt;This works&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPListItem&lt;/span&gt;&amp;nbsp;item&amp;nbsp;=&amp;nbsp;list.Items[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;item.Attachments.Add(&lt;span style="color: #a31515;"&gt;"tratata.txt"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Encoding&lt;/span&gt;.Default.GetBytes(&lt;span style="color: #a31515;"&gt;"tratata"&lt;/span&gt;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;item.Update();&lt;/pre&gt;But this doesn't&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Items[0].Attachments.Add(&lt;span style="color: #a31515;"&gt;"tratata.txt"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Encoding&lt;/span&gt;.Default.GetBytes(&lt;span style="color: #a31515;"&gt;"tratata"&lt;/span&gt;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Items[0].Update();&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="RegisterEventReceiver"&gt;Dynamically register an event receiver&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPList&lt;/span&gt;&amp;nbsp;lstVendors&amp;nbsp;=&amp;nbsp;web.Lists[&lt;span style="color: #a31515;"&gt;"My&amp;nbsp;Vendors"&lt;/span&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;asmName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"MyAssembly,&amp;nbsp;Version=1.0.0.0,&amp;nbsp;Culture=neutral,&amp;nbsp;PublicKeyToken=12345677"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;nbsp;itemReceiverName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"MyFeatures.ItemEventReceiver"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lstVendors.EventReceivers.Add(&lt;span style="color: #2b91af;"&gt;SPEventReceiverType&lt;/span&gt;.ItemAdding,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;asmName,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;itemReceiverName);&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="ListIISServers"&gt;List the IIS virtual servers on a Windows SharePoint Services server farm&lt;/h3&gt;&lt;pre&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;foreach&lt;/span&gt;&amp;nbsp;(SPServer&amp;nbsp;server&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;SPFarm.Local.Servers)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="ListUserSites"&gt;List the sites available to the current user&lt;/h3&gt;Note that the code below most probably leaks &lt;i&gt;a lot&lt;/i&gt;&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebServiceCollection&lt;/span&gt;&amp;nbsp;webServices&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebServiceCollection&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;SPFarm&lt;/span&gt;.Local);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPWebService&lt;/span&gt;&amp;nbsp;webService&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;webServices)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPWebApplication&lt;/span&gt;&amp;nbsp;webApp&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;webService.WebApplications)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt;&amp;nbsp;site&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;webApp.Sites)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPWeb&lt;/span&gt;&amp;nbsp;web&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;site.AllWebs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&amp;nbsp;(web.EffectiveBasePermissions&amp;nbsp;!=&amp;nbsp;0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Response.Write(&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"Have&amp;nbsp;access&amp;nbsp;to&amp;nbsp;URL&amp;nbsp;{0}&amp;lt;br/&amp;gt;"&lt;/span&gt;,&amp;nbsp;web.Url));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="CreateSite"&gt;Create a site&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPContext&lt;/span&gt;.Current.Web.AllowUnsafeUpdates&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebServiceCollection&lt;/span&gt;&amp;nbsp;webServices&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebServiceCollection&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;SPFarm&lt;/span&gt;.Local);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPWebService&lt;/span&gt;&amp;nbsp;webService&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;webServices)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;foreach&lt;/span&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;SPWebApplication&lt;/span&gt;&amp;nbsp;webApp&amp;nbsp;&lt;span style="color: blue;"&gt;in&lt;/span&gt;&amp;nbsp;webService.WebApplications)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPSite&lt;/span&gt;&amp;nbsp;site&amp;nbsp;=&amp;nbsp;webApp.Sites.Add(&lt;span style="color: #a31515;"&gt;"sites/test"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #a31515;"&gt;"val"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #a31515;"&gt;"val@ggg.com"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;webApp.Update();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;break&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="AddQuickLaunch"&gt;Add an item to the QuickLaunch menu&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.Navigation.QuickLaunch.AddAsLast(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;SPNavigationNode(&lt;span style="color: #a31515;"&gt;"My&amp;nbsp;link"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #a31515;"&gt;"http://www.microsoft.com"&lt;/span&gt;,&amp;nbsp;&lt;span style="color: blue;"&gt;true&lt;/span&gt;));&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="ModifyTopNav"&gt;Modify an item on the top navigation menu&lt;/h3&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPNavigationNode&lt;/span&gt;&amp;nbsp;node&amp;nbsp;=&amp;nbsp;web.Navigation.TopNavigationBar[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node.Title&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"MyTitle"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node.Update();&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="CreateGroup"&gt;Create a custom site group and set permissions for the group&lt;/h3&gt;It is only possible to add groups to the SPWeb.SiteGroups collection, not to the SPWeb.Groups collection.&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.SiteGroups.Add(&lt;span style="color: #a31515;"&gt;"MyGroup1"&lt;/span&gt;,&amp;nbsp;web.CurrentUser,&amp;nbsp;&lt;span style="color: blue;"&gt;null&lt;/span&gt;,&amp;nbsp;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;.Empty);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPGroup&lt;/span&gt;&amp;nbsp;group1&amp;nbsp;=&amp;nbsp;web.SiteGroups[&lt;span style="color: #a31515;"&gt;"MyGroup1"&lt;/span&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPRoleAssignment&lt;/span&gt;&amp;nbsp;arole&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPRoleAssignment&lt;/span&gt;(group1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arole.RoleDefinitionBindings.Add(web.RoleDefinitions[&lt;span style="color: #a31515;"&gt;"Full&amp;nbsp;Control"&lt;/span&gt;]);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;web.FirstUniqueAncestor.RoleAssignments.Add(arole);&lt;/pre&gt;&lt;br /&gt;&lt;h3 id="AddCrossSiteGroup"&gt;Add a cross-site group to a site group on different site&lt;/h3&gt;From Joel Oleson's &lt;a href="http://blogs.msdn.com/b/joelo/archive/2007/06/29/sharepoint-groups-permissions-site-security-and-depreciated-site-groups.aspx"&gt;blog&lt;/a&gt; "In Windows SharePoint Services 3.0, there is only one kind of group, previously called a cross-site group".&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://www.mindfiresolutions.com/SharePoint-Groups-vs-SiteGroups--Mindfire-Solutions-955.php"&gt;another blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SPWeb.Groups will allow you to pull out only the groups which have some / any kind of permissions defined within the site.&lt;br /&gt;&lt;br /&gt;SPWeb.SiteGroups will pull out all the cross-site groups irrespective of any permission defined.&lt;br /&gt;&lt;br /&gt;So, the next time you try to pull out the Groups using SPWeb.Groups, you will not get astonished by not finding few of the Groups within the retrieved collection.&lt;br /&gt;&lt;br /&gt;Note: The same also applies to the cross-site user collection retrieval using either SPWeb.Users or SPWeb.SiteUsers.&lt;br /&gt;&lt;br /&gt;&lt;h3 id="EnableRecords"&gt;Enable the records repository for the Send to menu&lt;/h3&gt;First, create a new site collection using Records Center template. Then specify the URL to Record Center's OfficialFile.asmx web service as follows:&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebApplication&lt;/span&gt;&amp;nbsp;app&amp;nbsp;=&amp;nbsp;&lt;span style="color: #2b91af;"&gt;SPWebApplication&lt;/span&gt;.Lookup(&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"http://val-2003/"&lt;/span&gt;));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app.OfficialFileName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"My&amp;nbsp;Records"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app.OfficialFileUrl&amp;nbsp;=&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"http://val-2003/sites/Records/_vti_bin/OfficialFile.asmx"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;app.Update();&lt;/pre&gt;&lt;br /&gt;Passed. Phew.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8132504974951123136?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8132504974951123136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8132504974951123136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8132504974951123136'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/08/ts-70-541-wss-30-application.html' title='TS: 70-541 WSS 3.0 - Application Development Exam Notes'/><author><name>val</name><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/_9173_HUvI4c/THqsETq7_yI/AAAAAAAAARU/eQKGNAnK4hI/s72-c/SpBasePermissions.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-5056380472741452858</id><published>2010-08-27T22:35:00.005-04:00</published><updated>2010-08-27T22:41:47.059-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS'/><title type='text'>BDC and WebService integer parameter problem in SpecificFinder</title><content type='html'>So you want to expose some data via a web service and consume it in MOSS via BDC. You read a bit about how it's done and fire up Visual Studio expecting it to be totally easy. It's Sharepoint, after all, it's supposed to be easy. You create a completely straightforward service&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//omitting&amp;nbsp;most&amp;nbsp;of&amp;nbsp;the&amp;nbsp;implementation&amp;nbsp;for&amp;nbsp;brevity&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;DataContract&lt;/span&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Product&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;ServiceContract&lt;/span&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;IProductService&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;OperationContract&lt;/span&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Product&lt;/span&gt;&amp;nbsp;GetProductById(&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;nbsp;Id);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;ProductService&lt;/span&gt;&amp;nbsp;:&amp;nbsp;&lt;span style="color: #2b91af;"&gt;IProductService&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Product&lt;/span&gt;&amp;nbsp;GetProductById(&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;nbsp;Id)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Product&lt;/span&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;br /&gt;You then fire up Application Definition Designer and make all appropriate changes (again, only SpecificFinder method instance is shown)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9173_HUvI4c/THhvNUr4cfI/AAAAAAAAARE/pKTLMdrFZO4/s1600/ADD_LOB.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="440" src="http://4.bp.blogspot.com/_9173_HUvI4c/THhvNUr4cfI/AAAAAAAAARE/pKTLMdrFZO4/s640/ADD_LOB.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And then you try to test the instance of your SpecificFinder&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/THhwrOjw3TI/AAAAAAAAARM/Y3vJhMvoWTM/s1600/ADD_Execute.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://3.bp.blogspot.com/_9173_HUvI4c/THhwrOjw3TI/AAAAAAAAARM/Y3vJhMvoWTM/s640/ADD_Execute.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;That's when it gets interesting because in the debugger you see that the parameter value actually passed to the web service is 0, not 1 as you specified.What's fantastic about it is that if you change the data type of the parameter from int to string and redo the application definition then it works fine. Definitely time to think about applying some service pack but apparently you are already running all the latest and greatest. So now what do you do?&lt;br /&gt;&lt;br /&gt;After a couple hours it dawned on me to check the actual SOAP message:&lt;br /&gt;&lt;br /&gt;&amp;lt;soap:Body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;GetProductById xmlns="http://tempuri.org/"&amp;gt;&amp;lt;/GetProductById&amp;gt;&lt;br /&gt;&amp;lt;/soap:Body&amp;gt;&lt;br /&gt;&lt;br /&gt;The parameter is simply not there at all! Whatsoever! Then I recalled reading about those "IdSpecified" fields, how they "improve compatibility" and how one "shouldn't worry about them". I thought that may be, just may be, they are not as irrelevant at all. So I added a default value of True to the IdSpecified parameter above. That&amp;nbsp; fixed it. Amazingly enough.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5056380472741452858?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5056380472741452858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/08/bdc-and-webservice-integer-parameter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5056380472741452858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5056380472741452858'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/08/bdc-and-webservice-integer-parameter.html' title='BDC and WebService integer parameter problem in SpecificFinder'/><author><name>val</name><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/_9173_HUvI4c/THhvNUr4cfI/AAAAAAAAARE/pKTLMdrFZO4/s72-c/ADD_LOB.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-8550704344194657061</id><published>2010-08-25T22:09:00.000-04:00</published><updated>2010-08-25T22:09:46.163-04:00</updated><title type='text'>Sharepoint 2007 SDKs</title><content type='html'>&lt;a href="http://msdn.microsoft.com/en-us/library/ms441339%28office.12%29.aspx"&gt;Windows SharePoint Services SDK&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms550992%28office.12%29.aspx"&gt;Microsoft Office SharePoint Server 2007 SDK&lt;/a&gt;. Lots of samples, in particular using InfoPath forms as workflow initiation, etc forms. Btw, they were updated since 2007.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8550704344194657061?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8550704344194657061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/08/sharepoint-2007-sdks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8550704344194657061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8550704344194657061'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/08/sharepoint-2007-sdks.html' title='Sharepoint 2007 SDKs'/><author><name>val</name><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-4420197003505233862.post-432813928191185713</id><published>2010-08-25T22:04:00.000-04:00</published><updated>2010-08-25T22:04:56.644-04:00</updated><title type='text'>Cool things about VS2010 and .Net 4.0</title><content type='html'>Cool VS things:&lt;br /&gt;&lt;a href="http://blogs.msdn.com/gblock/archive/2008/09/26/what-is-the-managed-extensibility-framework.aspx"&gt;MEF&lt;/a&gt;&lt;br /&gt;Cool C# things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Named and optional parameters (ala VB)&lt;/li&gt;&lt;li&gt;Variance!!! IEnumerable&amp;lt;Animal&amp;gt;=new IEnumerable&amp;lt;Elephant&amp;gt;() &lt;/elephant&gt;&lt;/animal&gt;&lt;/li&gt;&lt;li&gt;Not too cool, but still – ExpandoObject and DynamicObject.TryGetMember&lt;/li&gt;&lt;li&gt;Tuple&amp;lt;int,int,int,etc&amp;gt;  - generic for Pair, Triade, etc&lt;/int,int,int,etc&gt;&lt;/li&gt;&lt;li&gt;FlagsAttribute on enums and Enum.HasFlag()&lt;/li&gt;&lt;li&gt;String.IsNullOrWhiteSpace&lt;/li&gt;&lt;li&gt;Class StopWatch&lt;/li&gt;&lt;li&gt;Parallel.For() and Parallel.ForEach()&lt;/li&gt;&lt;li&gt;From s in stocks.AsParallel() let result=CallService(s) select result;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-432813928191185713?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/432813928191185713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/08/cool-things-about-vs2010-and-net-40.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/432813928191185713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/432813928191185713'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/08/cool-things-about-vs2010-and-net-40.html' title='Cool things about VS2010 and .Net 4.0'/><author><name>val</name><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-4420197003505233862.post-7154900265616713069</id><published>2010-08-09T19:56:00.000-04:00</published><updated>2010-08-09T19:56:51.861-04:00</updated><title type='text'>Software development resources recommendations:</title><content type='html'>&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;From&amp;nbsp;&lt;a href="http://blogs.msdn.com/b/jobsblog/archive/2008/06/17/dev.aspx"&gt;Software Development Engineer (SDE) interviews at Microsoft&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Box, Don. &lt;i&gt;Essential.NET, Volume I: The Common Language Runtime&lt;/i&gt;. Addison-Wesley Professional, 2003.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Brooks, Fredrick. &lt;i&gt;The Mythical Man-Month: Essays on Software Engineering&lt;/i&gt;. Addison-Wesley Professional, 1995.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Cormen, T.H., Leiserson, C.E., Reivert, R.L., Stein, Cliff, eds. &lt;i&gt;Introduction to Algorithms&lt;/i&gt;. McGraw-Hill, 1990.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Howard, Michael, LeBlanc, David, eds. &lt;i&gt;Writing Secure Code&lt;/i&gt;. Microsoft Press, 2001.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Maguire, Steve. &lt;i&gt;Writing Solid Code:&amp;nbsp;Microsoft’s Techniques for Developing Bug-Free C Programs&lt;/i&gt;. Microsoft Press, 1993.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;McConnell, Steve. &lt;i&gt;Code Complete: A Practical Handbook of Software Construction&lt;/i&gt;. Microsoft Press, 1993.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;McConnell, Steve. &lt;i&gt;Rapid Development:&amp;nbsp;Taming Wild Software Schedules&lt;/i&gt;. Microsoft Press, 1996.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Tanenbaum, Andrew. &lt;i&gt;Modern Operating Systems. second edition&lt;/i&gt;. Prentice Hall, 2001.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7154900265616713069?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7154900265616713069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/08/software-development-resources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7154900265616713069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7154900265616713069'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/08/software-development-resources.html' title='Software development resources recommendations:'/><author><name>val</name><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-4420197003505233862.post-2770324773814243566</id><published>2010-07-22T00:34:00.001-04:00</published><updated>2010-07-22T01:10:11.743-04:00</updated><title type='text'>SRMSVC Warning</title><content type='html'>I keep getting the following warning on the 2003 box:&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;Event Type:&amp;nbsp;&amp;nbsp;&amp;nbsp; Warning&lt;br /&gt;Event Source:&amp;nbsp;&amp;nbsp;&amp;nbsp; SRMSVC&lt;br /&gt;Event Category:&amp;nbsp;&amp;nbsp;&amp;nbsp; None&lt;br /&gt;Event ID:&amp;nbsp;&amp;nbsp;&amp;nbsp; 12317&lt;br /&gt;Description:&lt;br /&gt;File Server Resource Manager failed to enumerate share paths or DFS paths.&amp;nbsp; Mappings from local file paths to share and DFS paths may be incomplete or temporarily unavailable.&amp;nbsp; FSRM will retry the operation at a later time. &lt;br /&gt;&lt;br /&gt;Error-specific details:&lt;br /&gt;&amp;nbsp;&amp;nbsp; Error: NetShareEnum, 0x80070842, The Server service is not started.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Google search turned up some blurb about this being related to some known bug and the workaround being to disable DFS polling thread (mentioned &lt;a href="http://support.microsoft.com/kb/973071"&gt;here&lt;/a&gt;). To disable it set the value of     the DisableSearchDfs registry entry to 1 under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrmSvc\Settings&lt;br /&gt;&lt;br /&gt;Can't seem to find any more details. I changed the setting as described after which all hell broke loose - the box went into BSOD in a few minutes and after reboot BSOD'ed with different stop codes. I changed the setting back to 0 in the safe mode and then was able to boot normally. Guess I'll have to live with the warning.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2770324773814243566?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2770324773814243566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/07/srmsvc-warning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2770324773814243566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2770324773814243566'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/07/srmsvc-warning.html' title='SRMSVC Warning'/><author><name>val</name><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-4420197003505233862.post-4015036223364843950</id><published>2010-07-13T23:57:00.000-04:00</published><updated>2010-07-13T23:57:11.266-04:00</updated><title type='text'>Windows Time Sync</title><content type='html'>It's &lt;b&gt;w32tm&amp;nbsp;&lt;/b&gt;&lt;br /&gt;What I usually need is probably w32tm /resync&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4015036223364843950?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4015036223364843950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/07/windows-time-sync.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4015036223364843950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4015036223364843950'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/07/windows-time-sync.html' title='Windows Time Sync'/><author><name>val</name><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-4420197003505233862.post-1061217600688241776</id><published>2010-07-07T18:44:00.001-04:00</published><updated>2010-07-07T18:44:43.542-04:00</updated><title type='text'>Empty Lambda</title><content type='html'>One of those pesky interview questions. Here it is: () =&gt; { }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1061217600688241776?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1061217600688241776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/07/empty-lambda.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1061217600688241776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1061217600688241776'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/07/empty-lambda.html' title='Empty Lambda'/><author><name>val</name><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-4420197003505233862.post-1274220359484960809</id><published>2010-07-07T16:01:00.006-04:00</published><updated>2011-04-05T13:56:19.424-04:00</updated><title type='text'>Custom filtering by Sharepoint Group in SSRS report</title><content type='html'>Recently I had a requirement to create a pie chart report using SSRS. The twist was that the report has to be shown on Sharepoint site and should show different data depending on what custom User Group current user is a member of. E.g. members of certain groups will see all the data but members of department-specific groups would see only data related to their department. &lt;br /&gt;&lt;br /&gt;My first intention was to create a connectable web part which would take an input parameter from Current User Name web part, check the groups user belongs to and supply an output parameter to the Report Viewer web part indicating whether to show all data or just for a specific department. However, on that particular project we had to run Report Server in native mode because we needed to have &lt;a href="http://vkirshin.blogspot.com/2010/05/error-occurred-during-client-rendering.html"&gt;Anonymous access enabled&lt;/a&gt;. The problem is that native mode Report Viewer web part does not support getting report parameters via web part connection.&lt;br /&gt;&lt;br /&gt;Therefore, I had to make it complex :-) &lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;First, I created a Data Source pointing to UserGroups Sharepoint web service:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9173_HUvI4c/TDTZKcTsPWI/AAAAAAAAAQc/qMrrb3_cgjk/s1600/DataSource.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_9173_HUvI4c/TDTZKcTsPWI/AAAAAAAAAQc/qMrrb3_cgjk/s320/DataSource.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;Then I created a DataSet that calls GetGroupCollectionFromUser web service method supplying the current user name as the parameter and returning all Sharepoint groups the user belongs to:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_9173_HUvI4c/TDTZkbo-CcI/AAAAAAAAAQk/N0PMMa5khH0/s1600/DataSetQuery.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_9173_HUvI4c/TDTZkbo-CcI/AAAAAAAAAQk/N0PMMa5khH0/s320/DataSetQuery.JPG" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/TDTZnf1r3KI/AAAAAAAAAQs/7uajd1vbmAc/s1600/DataSetParameters.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9173_HUvI4c/TDTZnf1r3KI/AAAAAAAAAQs/7uajd1vbmAc/s320/DataSetParameters.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The query text is actually as follows:&lt;br /&gt;&lt;pre&gt;&amp;lt;Query&amp;gt;&lt;br /&gt;&amp;lt;SoapAction&amp;gt;http://schemas.microsoft.com/sharepoint/soap/directory/GetGroupCollectionFromUser&lt;br /&gt;&amp;lt;/SoapAction&amp;gt;&lt;br /&gt;&amp;lt;Method Name="GetGroupCollectionFromUser" &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Namespace="http://schemas.microsoft.com/sharepoint/soap/directory/"&amp;gt;&lt;br /&gt;&amp;lt;ElementPath IgnoreNamespaces="True"&amp;gt;*&amp;lt;/ElementPath&amp;gt;&lt;br /&gt;&amp;lt;/Method&amp;gt;&lt;br /&gt;&amp;lt;/Query&amp;gt;&lt;/pre&gt;Note that the parameter is not included in the query but rather as a normal DataSet parameter.&lt;br /&gt;&lt;br /&gt;Then I created a report parameter and loaded the list of groups into it:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9173_HUvI4c/TDTaLLLKD9I/AAAAAAAAAQ0/6XaYFfAT9hU/s1600/ParameterGeneral.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_9173_HUvI4c/TDTaLLLKD9I/AAAAAAAAAQ0/6XaYFfAT9hU/s320/ParameterGeneral.JPG" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_9173_HUvI4c/TDTaN5E-8-I/AAAAAAAAAQ8/9fV-sWIs71k/s1600/ParameterDefault.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_9173_HUvI4c/TDTaN5E-8-I/AAAAAAAAAQ8/9fV-sWIs71k/s320/ParameterDefault.JPG" /&gt;&lt;/a&gt;&lt;/div&gt;Now I have a multivalue parameter containing the list of groups. The following custom code carries out the business logic:&lt;br /&gt;&lt;span class="class1"&gt;&lt;br /&gt;Public Function GetDepartmentName(ByVal UserGroups As Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Parameter) As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i=0 To UserGroups.Count&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; If UserGroups.Value(i)="aaaa" OrElse _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; UserGroups.Value(i)="bbbb" Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 'business logic&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return String.Empty&lt;br /&gt;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had a fun time transitioning to VB.Net for this exercise :-) Now the following expression:&lt;br /&gt;&lt;span class="class1"&gt;=Code.GetDepartmentName(Parameters!UserGroups)&lt;/span&gt;&lt;br /&gt;would give me the string I can filter on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1274220359484960809?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1274220359484960809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/07/custom-filtering-by-sharepoint-group-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1274220359484960809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1274220359484960809'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/07/custom-filtering-by-sharepoint-group-in.html' title='Custom filtering by Sharepoint Group in SSRS report'/><author><name>val</name><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/_9173_HUvI4c/TDTZKcTsPWI/AAAAAAAAAQc/qMrrb3_cgjk/s72-c/DataSource.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-2644190549176678547</id><published>2010-07-02T15:54:00.005-04:00</published><updated>2010-07-02T16:00:43.390-04:00</updated><title type='text'>Programmatically process Nintex Request Review or Request Approval workflow tasks</title><content type='html'>The following code processes a Request Review Nintex task. It requires Nintex.Workflow.dll which is a part of Nintex SDK. The SDK also contains necessary documentation.&lt;br /&gt;&lt;pre&gt;&lt;p&gt;&lt;span class="class4"&gt; SPList&lt;/span&gt;&lt;span class="class1"&gt; list = &lt;/span&gt;&lt;span class="class4"&gt;SPContext&lt;/span&gt;&lt;span class="class1"&gt;.Current.Web.Lists[&lt;/span&gt;&lt;span class="class5"&gt;"Workflow Tasks"&lt;/span&gt;&lt;span class="class1"&gt;];&lt;/span&gt;&lt;br /&gt; &lt;span class="class4"&gt;SPQuery&lt;/span&gt;&lt;span class="class1"&gt; query = &lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt; &lt;span class="class4"&gt;SPQuery&lt;/span&gt;&lt;span class="class1"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt; query.Query = &lt;/span&gt;&lt;span class="class0"&gt;string&lt;/span&gt;&lt;span class="class1"&gt;.Concat(&lt;/span&gt;&lt;br /&gt; &lt;span class="class5"&gt;    "&amp;lt;Where&amp;gt;&amp;lt;Contains&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;br /&gt; &lt;span class="class5"&gt;    "&amp;lt;FieldRef Name='WorkflowLink'/&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;br /&gt; &lt;span class="class5"&gt;    "&amp;lt;Value Type='Text'&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt; + name + &lt;/span&gt;&lt;span class="class5"&gt;"&amp;lt;/Value&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;br /&gt; &lt;span class="class5"&gt;    "&amp;lt;/Contains&amp;gt;&amp;lt;/Where&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt; &lt;span class="class4"&gt;SPListItemCollection&lt;/span&gt;&lt;span class="class1"&gt; items = list.GetItems(query);&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt; (items.Count &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt; {&lt;/span&gt;&lt;br /&gt; &lt;span class="class4"&gt;    SPListItem&lt;/span&gt;&lt;span class="class1"&gt; task = items[0];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="class3"&gt;    //(int) is important, otherwise will get "Invalid data" exception upon update&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;    task[Nintex.Workflow.Common.&lt;/span&gt;&lt;span class="class4"&gt;NWSharePointObjects&lt;/span&gt;&lt;span class="class1"&gt;.FieldDecision] = (&lt;/span&gt;&lt;span class="class0"&gt;int&lt;/span&gt;&lt;span class="class1"&gt;)&lt;/span&gt;&lt;span class="class4"&gt;Outcome&lt;/span&gt;&lt;span class="class1"&gt;.Continue;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;    task[Nintex.Workflow.Common.&lt;/span&gt;&lt;span class="class4"&gt;NWSharePointObjects&lt;/span&gt;&lt;span class="class1"&gt;.FieldComments] = &lt;/span&gt;&lt;span class="class5"&gt;"My comments"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="class1"&gt;    task.Update();&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt; }&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2644190549176678547?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2644190549176678547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/07/programmatically-process-nintex-request.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2644190549176678547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2644190549176678547'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/07/programmatically-process-nintex-request.html' title='Programmatically process Nintex Request Review or Request Approval workflow tasks'/><author><name>val</name><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-4420197003505233862.post-4076006508501853802</id><published>2010-06-26T01:09:00.001-04:00</published><updated>2010-06-26T01:21:20.027-04:00</updated><title type='text'>Relative URL in master pages on WSS 3.0</title><content type='html'>I was messing around with &lt;a href="http://www.vkirshin.com/"&gt;www.vkirshin.com&lt;/a&gt; again, which I expect to be doing for quite some time now. Today I ran into the problem of having relative URLs in the master page. My problem was with the &amp;lt;td style=&amp;quot;background-image:url('Lists/Picture Library/bk.jpg')&amp;quot;&amp;gt;. It does not work if the page is in a subfolder rather than the root of the web site. &lt;br /&gt;&lt;br /&gt;The common workaround is to use SPUrl expression builder. Unfortunately, my hosting is WSS-only but SPUrl is a part of Publishing feature which is a part of MOSS. &lt;br /&gt;&lt;br /&gt;I have tried &lt;a href="http://msdn.microsoft.com/en-us/library/ms431831.aspx"&gt;URL tokens&lt;/a&gt; in various combinations but to no avail. &lt;br /&gt;&lt;br /&gt;Finally I got it - I put the style into a CSS class which resides in a CSS file. Then the relative URLs will always be resolved based on the location of the CSS file rather than the location of the page.&lt;br /&gt;&lt;br /&gt;Well. Designer would have known that already.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4076006508501853802?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4076006508501853802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/relative-url-in-master-pages-on-wss-30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4076006508501853802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4076006508501853802'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/relative-url-in-master-pages-on-wss-30.html' title='Relative URL in master pages on WSS 3.0'/><author><name>val</name><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-4420197003505233862.post-8574347693959900309</id><published>2010-06-25T16:32:00.006-04:00</published><updated>2010-06-25T17:30:15.603-04:00</updated><title type='text'>Hilarious - Windows Resource Protection (WRP) and ActiveX Control Installation on Windows Vista</title><content type='html'>This is one hilarious post &lt;a href="http://blogs.msdn.com/b/cjacks/archive/2007/04/20/windows-resource-protection-wrp-and-activex-control-installation-on-windows-vista.aspx"&gt;Windows Resource Protection (WRP) and ActiveX Control Installation on Windows Vista&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I found it while trying to fix Event 10016 errors &lt;i&gt;"The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {61738644-F196-11D0-9953-00C04FD919C1} and APPID {61738644-F196-11D0-9953-00C04FD919C1}" &lt;/i&gt;on a Windows 2008 server&lt;i&gt;.&lt;/i&gt;&lt;br /&gt;Per the error message, the Sharepoint's user account needs to have Local Activation premission for IIS WAMREG application. On Windows 2003 it is fixed by granting those permissions in the Component Services configuration. But in 2008 these settings are disabled, apparently because only TrustedInstaller account has rights to modify those permissions.&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="http://blogs.msdn.com/b/emeadaxsupport/archive/2010/01/26/unable-to-edit-the-dcom-settings-for-iis-wamreg-admin-service-on-a-windows-server-2008-r2-when-trying-to-configure-kerberos-authentication-for-role-centers.aspx"&gt;workaround&lt;/a&gt; describing how to allow Administrators to do that as well. Note that changing the owner appears to be a one-way operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8574347693959900309?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8574347693959900309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/hilarious-windows-resource-protection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8574347693959900309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8574347693959900309'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/hilarious-windows-resource-protection.html' title='Hilarious - Windows Resource Protection (WRP) and ActiveX Control Installation on Windows Vista'/><author><name>val</name><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-4420197003505233862.post-6956133622818859399</id><published>2010-06-24T16:17:00.000-04:00</published><updated>2010-06-24T16:17:05.926-04:00</updated><title type='text'>Apps4Rent and DNS and Sharepoint Part 2</title><content type='html'>Finally!&lt;br /&gt;In the DNS for &lt;i&gt;vkirshin.com&lt;/i&gt; I now only have a CName record &lt;i&gt;www-&amp;gt;sharepoint.hostmailserver.com&lt;/i&gt;. No A record at all. Then I have used GoDaddy's forwarding feature to set up permanent forwarding of &lt;i&gt;vkirshin.com&lt;/i&gt; to &lt;i&gt;www.vkirshin.com&lt;/i&gt;. Now they both work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-6956133622818859399?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/6956133622818859399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/apps4rent-and-dns-and-sharepoint-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6956133622818859399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/6956133622818859399'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/apps4rent-and-dns-and-sharepoint-part-2.html' title='Apps4Rent and DNS and Sharepoint Part 2'/><author><name>val</name><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-4420197003505233862.post-1708565025680799177</id><published>2010-06-23T17:18:00.004-04:00</published><updated>2010-06-24T16:29:24.768-04:00</updated><title type='text'>Update for "Reference a field group in InfoPath"</title><content type='html'>An update to &lt;a href="http://vkirshin.blogspot.com/2010/06/reference-field-group-in-infopath.html"&gt;this post&lt;/a&gt;&lt;br /&gt;It appears that the above problem was specific to the form I was working  on. A created from scratch blank form worked as expected.&lt;br /&gt;&lt;br /&gt;There was a view containing a Repeating Table bound to the Positions element mentioned on the screenshots of the original post. The PositionID field was actually a sequence number rather than a real ID. It was not editable, instead it had a Default Value specified as &lt;br /&gt;&lt;pre&gt;count(preceding::my:PositionID) + 1&lt;/pre&gt;The intent, apparently, was to get the number of rows in the PositionsTable element before the current node. Looking at that XPath, I do not understand why it worked but it did. However, once I removed it, I was able to upload and use the form with referenced fields set up as I wanted. So I have replaced the expression above with &lt;br /&gt;&lt;pre&gt;count(../preceding-sibling::my:PositionsTable) + 1&lt;/pre&gt;That definitely makes more sense to me, works, and still does not break the referenced fields. Hurray!&lt;br /&gt;&lt;br /&gt;BTW, now I know that in manifest.xsf xsf:calculations element lists default values for  all fields&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1708565025680799177?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1708565025680799177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/update-for-reference-field-group-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1708565025680799177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1708565025680799177'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/update-for-reference-field-group-in.html' title='Update for &quot;Reference a field group in InfoPath&quot;'/><author><name>val</name><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-4420197003505233862.post-9045421548133148663</id><published>2010-06-22T13:01:00.007-04:00</published><updated>2010-06-24T16:17:44.933-04:00</updated><title type='text'>Apps4Rent and DNS and Sharepoint Part 1</title><content type='html'>I am about to go crazy.&lt;br /&gt;- Sunday I have created a blank Sharepoint web site on Apps4Rent hosting and pointed www.vkirshin.com to it. Then I have successfully restored a backup of the site I had in my VM to the hosted site. Problem is, I did not write down how exactly I had it set up.&lt;br /&gt;- I still had (and have) a problem that &lt;i&gt;vkirshin.com&lt;/i&gt; (without the www) does not work&lt;br /&gt;- So Monday I thought - it asks for a prefix to the domain name (called the site URL) when creating a web site through Apps4Rent control panel. I guess I have put www there to make the whole thing &lt;i&gt;www.vkirshin.com&lt;/i&gt;. I thought that if I will not put anything there, then may be Sharepoint will listen for &lt;i&gt;vkrishin.com&lt;/i&gt; host header and &lt;i&gt;vkirshin.com&lt;/i&gt; will work. Then I will be able to make a CName alias for www to make &lt;i&gt;www.vkirshin.com&lt;/i&gt; work as well. No luck - it requires a prefix. But it the process I have deleted the web site and created it again the same way. Or so it seemed.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;- Then I thought - ok, let's just restore the backup again and think about something else. However, the backup did not restore. The error was &lt;i&gt;"/Lists/Document Library/some_doc_file.doc cannot be created because its parent web does not exist"&lt;/i&gt;. I googled and googled but could not figure that out. Problem is, it is a hosted environment. I do not see logs nor have access to Central Admin. &lt;br /&gt;- Well, but I just emailed the URL to the site to someone. It just came up in the conversation so I could not resist. Therefore I manually copied the web site content to Apps4Rent and eventually the site was up again.&lt;br /&gt;- At this point I thought it would be a good idea to make a backup of hosted site, may be I will have a better luck restoring that if need be. I started the backup from Sharepoint Designer but it also errored out with "&lt;i&gt;The object &amp;lt;GUID&amp;gt;&lt;/i&gt;&lt;guid&gt;&lt;i&gt; that was configured as part of the Export Settings no longer exists&lt;/i&gt;". At that point I decided to call it a day. After a bit of unfruitful googling, of course.&lt;/guid&gt;&lt;br /&gt;- But then I deleted the site and recreated it using &lt;i&gt;sharepoint.valkirshin.apps4rent.info&lt;/i&gt; as the domain name. Then I was able to restore the backup successfully. Weird.&lt;br /&gt;- Then I spent some time playing with CName records trying to point &lt;i&gt;www.vkirshin.com&lt;/i&gt; to &lt;i&gt;sharepoint.valkirshin.apps4rent.info&lt;/i&gt;. But I guess Apps4Rent server did not really understand what I was trying to do.&lt;br /&gt;- Now, today, on Tuesday, I decided to give it another try. I have deleted the Sharepoint site at &lt;i&gt;sharepoint.valkirshin.apps4rent.info&lt;/i&gt;. Recreated it using &lt;i&gt;www.vkirshin.com&lt;/i&gt;. In DNS I have A record pointing to 198.77.13.246 and a CName record &lt;i&gt;www-&amp;gt;sharepoint.hostmailserver.com&lt;/i&gt;. That's it. The backup restored seamlessly. The backup of the hosted site went seamlessly as well.&lt;br /&gt;&lt;br /&gt;What gives, huh?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-9045421548133148663?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/9045421548133148663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/apps4rent-and-dns-and-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9045421548133148663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9045421548133148663'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/apps4rent-and-dns-and-sharepoint.html' title='Apps4Rent and DNS and Sharepoint Part 1'/><author><name>val</name><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-4420197003505233862.post-7377711914042300102</id><published>2010-06-20T21:16:00.003-04:00</published><updated>2010-06-20T22:00:26.716-04:00</updated><title type='text'>Backup from MOSS, restore on WSS</title><content type='html'>I paid for hosting on Apps4Rent. I'm not going to mention how I started by deleting my site and having to contact the support. Now I'm trying to upload my playground site from my work VM to the hosting site. The problem is that the VM is MOSS 2007 but hosting is WSS only. Apparently that is a problem, although I have not used any MOSS functionality on that site. So far got two errors.&lt;br /&gt;&lt;br /&gt;First, "Feature TransMgmtLib does not exist". This is called Translation Management Library in Site Features. Deactivated it and recreated the backup.&lt;br /&gt;&lt;br /&gt;Then "Feature DataConnectionLibrary does not exist". Could not find it in feature lists, so &lt;br /&gt;stsadm -o deactivatefeature -name DataConnectionLibrary -url http://site&lt;br /&gt;Recreated the backup again.&lt;br /&gt;&lt;br /&gt;Now it has succeeded&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7377711914042300102?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7377711914042300102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/backup-from-moss-restore-on-wss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7377711914042300102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7377711914042300102'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/backup-from-moss-restore-on-wss.html' title='Backup from MOSS, restore on WSS'/><author><name>val</name><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-4420197003505233862.post-8955462335000459757</id><published>2010-06-19T00:29:00.004-04:00</published><updated>2010-06-23T17:19:43.344-04:00</updated><title type='text'>Reference a field group in InfoPath</title><content type='html'>Something I cannot solve.&lt;br /&gt;Let's say I want to have two repeating data groups with exactly the same fields. Naturally, I do not want to create the same field definitions twice (or thrice in my case, actually). So, first I defined my repeating group (Positions is a group, PositionsTable is a repeating group):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_9173_HUvI4c/TBxErZea2gI/AAAAAAAAAP8/g0DgMF85tx4/s1600/Positions.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_9173_HUvI4c/TBxErZea2gI/AAAAAAAAAP8/g0DgMF85tx4/s320/Positions.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;Then I added a new group:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9173_HUvI4c/TBxFGk-r1gI/AAAAAAAAAQE/QXzJIoTw-Ho/s1600/DeletedPositions.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_9173_HUvI4c/TBxFGk-r1gI/AAAAAAAAAQE/QXzJIoTw-Ho/s320/DeletedPositions.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;Then I right-clicked the repeating group and selected "Reference..." option.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/TBxFt-5pmkI/AAAAAAAAAQM/KApJa1i9Y1I/s1600/Reference.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_9173_HUvI4c/TBxFt-5pmkI/AAAAAAAAAQM/KApJa1i9Y1I/s320/Reference.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;It prompted where to put the reference and I chose the new group I have created above.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_9173_HUvI4c/TBxF2eiDFoI/AAAAAAAAAQU/i5jTksDWMqc/s1600/FieldGroupReference.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/_9173_HUvI4c/TBxF2eiDFoI/AAAAAAAAAQU/i5jTksDWMqc/s400/FieldGroupReference.PNG" width="267" /&gt;&lt;/a&gt;&lt;/div&gt;It looks all well and good. It publishes OK. It supposed to be run in Sharepoint and it has a lot of code so it must be administrator approved. Therefore the xsn must be uploaded using Upload Form page in Central Administration. That's when I get "Unknown error occured" web page and the following exception in the Event Log:&lt;br /&gt;&lt;pre&gt;Event Type: Error&lt;br /&gt;Event Source: Office SharePoint Server Error Reporting&lt;br /&gt;Event Category: None&lt;br /&gt;Event ID: 5000&lt;br /&gt;Description:&lt;br /&gt;EventType ulsexception12, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, &lt;br /&gt;P4 microsoft.office.infopath.server, P5 12.0.6425.0, P6 4b68d9c5, &lt;br /&gt;P7 8290, P8 91, P9 nullreferenceexception, P10 82lx.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I just ran out of ideas what else to try.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;a href="http://vkirshin.blogspot.com/2010/06/update-for-reference-field-group-in.html"&gt;Update to this post&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8955462335000459757?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8955462335000459757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/reference-field-group-in-infopath.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8955462335000459757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8955462335000459757'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/reference-field-group-in-infopath.html' title='Reference a field group in InfoPath'/><author><name>val</name><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/_9173_HUvI4c/TBxErZea2gI/AAAAAAAAAP8/g0DgMF85tx4/s72-c/Positions.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-8422379809997988452</id><published>2010-06-18T00:40:00.000-04:00</published><updated>2010-06-18T00:40:27.412-04:00</updated><title type='text'>Sharepoint 2010 starter master page</title><content type='html'>Per Elisabeth Olson's &lt;a href="http://live.visitmix.com/MIX10/Sessions/PR02"&gt;presentation at MIX10&lt;/a&gt;, minimal.master is not the master page one should start with when creating a new general purpose site. It is used for things like web version of Excel or Access. Instead, they have a starter.master exactly to provide a barebone master page one can start with. It is supposed to be on Code Gallery now and should be included in the SDK&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8422379809997988452?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8422379809997988452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/sharepoint-2010-starter-master-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8422379809997988452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8422379809997988452'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/sharepoint-2010-starter-master-page.html' title='Sharepoint 2010 starter master page'/><author><name>val</name><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-4420197003505233862.post-1808670601850275404</id><published>2010-06-17T19:07:00.001-04:00</published><updated>2010-07-10T00:47:20.947-04:00</updated><title type='text'>Hiding content from Anonymous users with SPSecurityTrimmedControl</title><content type='html'>Like a lot of other people I was excited to discover SPSecurityTrimmedControl. Like most other people I was frustrated to find out that &lt;br /&gt;&lt;pre&gt;&amp;lt;Sharepoint:SPSecurityTrimmedControl runat="server"&lt;br /&gt; AuthenticationRestrictions="AuthenticatedUsersOnly"&amp;gt;&lt;/pre&gt;does not prevent anonymous users from seeing the content enclosed within SPSecurityTrimmedControl control. With .Net Reflector it becomes apparent why - the control first checks if the current user has permissions specified in PermissionString attribute. It is only after determining that the user has those permissions the value of AuthenticationRestrictions is being checked. Therefore,&amp;nbsp; &lt;br /&gt;&lt;ul&gt;&lt;li&gt;PermissionString must be specified, because it defaults to nothing&lt;/li&gt;&lt;li&gt;It must match what Anonymous users have. BrowseDirectories seems to be the bare minimum&lt;/li&gt;&lt;li&gt;Only then the content can be hidden from Anonymous users by specifying AuthenticationRestrictions&lt;/li&gt;&lt;/ul&gt;Therefore the following displays the content to authenticated users but not to anonymous ones&lt;br /&gt;&lt;pre&gt;&amp;lt;Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="BrowseDirectories" &lt;br /&gt;AuthenticationRestrictions="AuthenticatedUsersOnly"&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1808670601850275404?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1808670601850275404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/hiding-content-from-anonymous-users.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1808670601850275404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1808670601850275404'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/hiding-content-from-anonymous-users.html' title='Hiding content from Anonymous users with SPSecurityTrimmedControl'/><author><name>val</name><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-4420197003505233862.post-1788484667968376809</id><published>2010-06-17T14:19:00.001-04:00</published><updated>2010-06-22T13:07:44.156-04:00</updated><title type='text'>How to change the default page of a Sharepoint site</title><content type='html'>Site Settings / Modify All Settings / Welcome Page under Look and Feel category&lt;br /&gt;Unfortunately, this works only when publishing feature is enabled. So it basically requires MOSS.&lt;br /&gt;In WSS the home page can be changed through Sharepoint Designer, but apparently it still must reside in the root of the site, it cannot be in a Document Library. But then it cannot have custom permissions set, namely Anonymous access.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1788484667968376809?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1788484667968376809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/how-to-change-default-page-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1788484667968376809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1788484667968376809'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/how-to-change-default-page-of.html' title='How to change the default page of a Sharepoint site'/><author><name>val</name><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-4420197003505233862.post-727503163501389325</id><published>2010-06-15T23:10:00.001-04:00</published><updated>2011-06-04T16:18:37.982-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sharepoint 2010'/><title type='text'>Create New Web Application button is disabled in Sharepoint 2010 Central Administration</title><content type='html'>I was just now puzzled by this - the user account is a member of the Farm Administrators group but nonetheless the New button under Application Management was disabled. I guessed that since creating a new web app involves creating a new web site in IIS, new AppPool, etc, then the account might have to have administrative privileges on the server in addition to being a Farm Administrator. Adding the account to the server's Administrator group solved the problem for now.&lt;br /&gt;&lt;br /&gt;Update: I had another instance of the same problem recently, on a development setup of Server 2010 on Windows 7. The user was an administrator already, but I had to run IE as Administrator as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-727503163501389325?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/727503163501389325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/create-new-web-application-button-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/727503163501389325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/727503163501389325'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/create-new-web-application-button-is.html' title='Create New Web Application button is disabled in Sharepoint 2010 Central Administration'/><author><name>val</name><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-4420197003505233862.post-7471564864862160822</id><published>2010-06-08T13:48:00.001-04:00</published><updated>2010-06-15T23:23:57.251-04:00</updated><title type='text'>Sharepoint 2010 install log</title><content type='html'>&lt;div class="ExternalClass6A429EA7745447CF9E824D8BB4DDFAF5"&gt;&lt;ol&gt;&lt;li&gt;Got brand new Windows Server 2008 R2 64-bit VM. 50Gb HDD, 8Gb RAM, 2 CPUs. Yahoo! :-)&lt;/li&gt;&lt;li&gt;Installed Web Server role with all features that seemed to make sense&lt;/li&gt;&lt;li&gt;Working trough &lt;a href="http://msdn.microsoft.com/en-us/library/ee554869.aspx"&gt;Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7, and Windows Server 2008&lt;/a&gt;&amp;nbsp;article&lt;/li&gt;&lt;li&gt;Cannot install WCF Hotfix for Microsoft Windows (KB971831), it says that the update is not compatible with the computer. I have only .Net 2.0 installed, installing 3.5SP1 first.&lt;/li&gt;&lt;li&gt;3.5SP1 redistributable refuses to install saying that I need to use Role Manager to install it&lt;/li&gt;&lt;li&gt;Installed .Net 3.5.1 feature (along with Windows Process Activation)&lt;/li&gt;&lt;li&gt;Installed WCF Hotfix for Microsoft Windows (the download from the "Setting up Dev Env" points to Windows6.1-KB&lt;b&gt;976462&lt;/b&gt;-v2-x64.msu ? ). It requires restart???&lt;/li&gt;&lt;li&gt;Installing &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&amp;amp;displaylang=en"&gt;ADO.NET Data Services Update for .NET Framework 3.5 SP1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;At this point I realized that I am stupid and should not have started doing this on Friday afternoon. Because the first thing to install is, of course, the Visual Studio&lt;a name='more'&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Installing Visual Studio 2010. Premium. Wow. Installing everything but SQL Express. Space required 6.1 Gb&lt;/li&gt;&lt;li&gt;Restarting after .Net 4 installation step&lt;/li&gt;&lt;li&gt;Installing SQL Server 2008. When started, setup (or Windows, rather) complained that I will have to install SP1 before I will be able to run it on this version of Windows.&lt;/li&gt;&lt;li&gt;Got the "SQL Server Setup has encountered the following error: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.". The fix is in some cumulative update. I haven't even installed it yet!&lt;/li&gt;&lt;li&gt;Closed all windows per some tip online. Re-run the install. Installing everything. Space required 3.2Gb&lt;/li&gt;&lt;li&gt;Setup everything to run as Network Service, not configuring Reporting now, Mixed Auth and myself as admin. &lt;/li&gt;&lt;li&gt;Installed SQL Server 2008 SP1&lt;/li&gt;&lt;li&gt;Ran Sharepoint Server 2010 setup. It listed a number of prerequisites that are not installed.&lt;/li&gt;&lt;li&gt;Ran PrerequisiteInstaller.exe from Sharepoint package. It looks like it will install the required prerequisites. Btw, it downloads and installs 2008 R2 Reporting Addin&lt;/li&gt;&lt;li&gt;Now Sharepoint Server setup seems satisfied with the prerequisites, but demands the product key. &lt;/li&gt;&lt;li&gt;Not changing the config.xml file because installing on the server&lt;/li&gt;&lt;li&gt;Got the key, install successful. Chose Server Farm, then Complete&lt;/li&gt;&lt;li&gt;Runnig the Configuration Wizard. Creating new Server Farm. It complains that SQL Server ver 10.0.2531.0 is unsupported. Suggests to check out &lt;a href="http://go.microsoft.com/fwlink/?LinkId=165761"&gt;http://go.microsoft.com/fwlink/?LinkId=165761&lt;/a&gt;&amp;nbsp;for a list of supported versions. (Note that the page actually has information for 2010 as well as for WSS 3.0) Sure, the &lt;a href="http://technet.microsoft.com/en-us/library/cc262485.aspx"&gt;&lt;/a&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc262485.aspx"&gt;Hardware and software requirements (SharePoint Server 2010)&lt;/a&gt;&amp;nbsp;Lists SQL 2008 SP1 &lt;b&gt;CU2&lt;/b&gt;&lt;/li&gt;&lt;li&gt;Installed CU2, then the Configuration Wizard completed successfully. Now I'm in the Central Admin, trying to figure out what's going on :-)&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7471564864862160822?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7471564864862160822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/sharepoint-2010-install-log.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7471564864862160822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7471564864862160822'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/sharepoint-2010-install-log.html' title='Sharepoint 2010 install log'/><author><name>val</name><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-4420197003505233862.post-2599515214055554767</id><published>2010-06-03T18:43:00.000-04:00</published><updated>2010-06-15T23:24:53.922-04:00</updated><title type='text'>Postback from SSRS report hosted in Sharepoint/ASP.Net page</title><content type='html'>I was creating a web part hosting ReportViewer control in an ASP.Net User Control (as described &lt;a href="http://vkirshin.blogspot.com/2010/06/how-to-wrap-user-control-in-web-part.html"&gt;here&lt;/a&gt;). One of the requirements translated into a need to perform a page postback when an item in the report is clicked. I.e. setting TextBox' Action property to "Go To URL" was not enough. I figured that I will be able to do that if I pass control from the report to the web page. So I set the Action property to the following expression&lt;br /&gt;&lt;br /&gt;&lt;span class="class1"&gt;="javascript:void(MyPostback('"+ &amp;lt;some parameters identifying the item clicked&amp;gt;+ "'))"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That would call the javascript function MyPostback() when the TextBox is clicked thus passing the control from ReportViewer-generated code to my code. At first I thought the function will be really simple&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;    function&lt;/span&gt;&lt;span class="class1"&gt; MyPostback(par) {&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;      var&lt;/span&gt;&lt;span class="class1"&gt; hiddenField = document.getElementById(&lt;/span&gt;&lt;span class="class5"&gt;"&amp;lt;%=hiddenPar.ClientID%&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       hiddenField.value = par;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       __doPostBack(&lt;/span&gt;&lt;span class="class5"&gt;'MyPostbackTarget'&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class5"&gt;''&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It would save parameters in some hidden fields and then call the stock ASP.Net __doPostBack function with a custom event target. The page code then would handle the postback as follows&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;protected&lt;/span&gt; &lt;span class="class0"&gt;void&lt;/span&gt;&lt;span class="class1"&gt; Page_Load(&lt;/span&gt;&lt;span class="class0"&gt;object&lt;/span&gt;&lt;span class="class1"&gt; sender, &lt;/span&gt;&lt;span class="class4"&gt;EventArgs&lt;/span&gt;&lt;span class="class1"&gt; e)&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;{&lt;/span&gt;&lt;br /&gt;   &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt; (IsPostBack &amp;amp;&amp;amp; &lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       Request.Params[&lt;/span&gt;&lt;span class="class5"&gt;"__EVENTTARGET"&lt;/span&gt;&lt;span class="class1"&gt;] == &lt;/span&gt;&lt;span class="class5"&gt;"MyPostbackTarget"&lt;/span&gt;&lt;span class="class1"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   {&lt;/span&gt;&lt;br /&gt; &lt;span class="class3"&gt;      //do stuff&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;}&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;That almost worked, that is the page was posted back and the postback was handled successfully. However, there was a problem. I had the ReportViewer's toolbar visible, because I needed to provide a way for users to specify some report parameters. So the user would adjust the parameters and click on the "View Report" button to see the updated report. The "View Report" button also posts the page back, but it does not use __EVENTTARGET hidden field ASP.Net uses. Therefore, consider the following scenario:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Show the page for the first time&lt;/li&gt;&lt;li&gt;Click on the TextBox in the report&lt;/li&gt;&lt;li&gt;MyPostback() function calls __doPostBack(), which sets __EVENTTARGET field to my custom value and posts the page to the server&lt;/li&gt;&lt;li&gt;And here's the catch - for simplicity, let's just say that the page just does some stuff in the backgroundand returns the same page to the user&lt;/li&gt;&lt;li&gt;Now, when the page reloads, the user hits the browser's Back button&lt;/li&gt;&lt;li&gt;IE happily shows the original page, the user then changes report parameter and clicks "View Report"&lt;/li&gt;&lt;li&gt;The page is posted back to the server, but since ReportViewer does not use __doPostBack function, the __EVENTTARGET field still contains my custom value because it was saved by the browser in the history state &lt;/li&gt;&lt;li&gt;Therefore, my code in Page_Load decides that the TextBox in the report was clicked again which is not what I want at all.&lt;/li&gt;&lt;/ul&gt;To fix that behavior I had to distinguish between the postbacks from my function vs any other postback:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;   var&lt;/span&gt;&lt;span class="class1"&gt; MyPostbackCalled=&lt;/span&gt;&lt;span class="class0"&gt;false&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="class0"&gt;   function&lt;/span&gt;&lt;span class="class1"&gt; MyPostback(par) {&lt;/span&gt;&lt;br /&gt;        &lt;span class="class0"&gt;var&lt;/span&gt;&lt;span class="class1"&gt; hiddenField = document.getElementById(&lt;/span&gt;&lt;span class="class5"&gt;"&amp;lt;%=hiddenPar.ClientID%&amp;gt;"&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       hiddenField.value = par;&lt;/span&gt;&lt;br /&gt; &lt;span class="class1"&gt;      MyPostbackCalled=&lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       __doPostBack(&lt;/span&gt;&lt;span class="class5"&gt;'MyPostbackTarget'&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class5"&gt;''&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="class0"&gt;  function&lt;/span&gt;&lt;span class="class1"&gt; MySubmitHandler()&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   {&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;     if&lt;/span&gt;&lt;span class="class1"&gt;(!MyPostbackCalled) {&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;          var&lt;/span&gt;&lt;span class="class1"&gt; target=document.getElementById(&lt;/span&gt;&lt;span class="class5"&gt;'__EVENTTARGET'&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;            &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt;(target!=&lt;/span&gt;&lt;span class="class0"&gt;null&lt;/span&gt;&lt;span class="class1"&gt; &amp;amp;&amp;amp; target.value==&lt;/span&gt;&lt;span class="class5"&gt;'MyPostbackTarget'&lt;/span&gt;&lt;span class="class1"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;               target.value=&lt;/span&gt;&lt;span class="class5"&gt;''&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span class="class0"&gt;  if&lt;/span&gt;&lt;span class="class1"&gt; (document.forms[0].addEventListener != &lt;/span&gt;&lt;span class="class0"&gt;null&lt;/span&gt;&lt;span class="class1"&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       document.forms[0].addEventListener(&lt;/span&gt;&lt;span class="class5"&gt;'submit'&lt;/span&gt;&lt;span class="class1"&gt;, MySubmitHandler, &lt;/span&gt;&lt;span class="class0"&gt;false&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;  else&lt;/span&gt; &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt; (document.forms[0].attachEvent != &lt;/span&gt;&lt;span class="class0"&gt;null&lt;/span&gt;&lt;span class="class1"&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       document.forms[0].attachEvent(&lt;/span&gt;&lt;span class="class5"&gt;'onsubmit'&lt;/span&gt;&lt;span class="class1"&gt;, MySubmitHandler);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In retrospect, I did not have to use the __doPostBack() and I could have introduced another hidden field instead of using __EVENTTARGET to achieve the same result. I still would have had the same issue though and I prefer to use standard code whenever possible&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-2599515214055554767?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/2599515214055554767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/postback-from-ssrs-report-hosted-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2599515214055554767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/2599515214055554767'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/postback-from-ssrs-report-hosted-in.html' title='Postback from SSRS report hosted in Sharepoint/ASP.Net page'/><author><name>val</name><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-4420197003505233862.post-5359211435203874214</id><published>2010-06-02T15:03:00.000-04:00</published><updated>2010-06-15T23:26:03.501-04:00</updated><title type='text'>LyteBox from window.onload</title><content type='html'>&lt;a href="http://www.dolem.com/lytebox/"&gt;LyteBox &lt;/a&gt;is a great thing. However, I just had a problem opening a LyteBox frame during page loading. The problem is that LyteBox script uses global myLytebox object which is itself initialized in window.onload event. I.e. the following is from lytebox.js&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;   if&lt;/span&gt;&lt;span class="class1"&gt; (window.addEventListener) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       window.addEventListener(&lt;/span&gt;&lt;span class="class5"&gt;"load"&lt;/span&gt;&lt;span class="class1"&gt;, initLytebox, &lt;/span&gt;&lt;span class="class0"&gt;false&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   } &lt;/span&gt;&lt;span class="class0"&gt;else&lt;/span&gt; &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt; (window.attachEvent) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       window.attachEvent(&lt;/span&gt;&lt;span class="class5"&gt;"onload"&lt;/span&gt;&lt;span class="class1"&gt;, initLytebox);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   } &lt;/span&gt;&lt;span class="class0"&gt;else&lt;/span&gt;&lt;span class="class1"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       window.onload = &lt;/span&gt;&lt;span class="class0"&gt;function&lt;/span&gt;&lt;span class="class1"&gt;() { initLytebox(); }&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;  function&lt;/span&gt;&lt;span class="class1"&gt; initLytebox() { myLytebox = &lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt;&lt;span class="class1"&gt; LyteBox(); }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Therefore a script added using &lt;span class="class1"&gt;ClientScript.RegisterStartupScript()&lt;/span&gt; will not work because myLytebox is not initialized yet. The obvious approach&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="class1"&gt;&amp;nbsp;&lt;/span&gt; &lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;   function&lt;/span&gt;&lt;span class="class1"&gt; MyOpenLytebox()&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   {&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;      var&lt;/span&gt;&lt;span class="class1"&gt; a = document.createElement(&lt;/span&gt;&lt;span class="class5"&gt;"a"&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       a.title=&lt;/span&gt;&lt;span class="class5"&gt;"My title"&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       a.rel = &lt;/span&gt;&lt;span class="class5"&gt;"lyteframe"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       a.rev = &lt;/span&gt;&lt;span class="class5"&gt;"width: 800px; height: 600px; scrolling: yes;"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       a.href=&lt;/span&gt;&lt;span class="class5"&gt;"http://myurl"&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;      if&lt;/span&gt;&lt;span class="class1"&gt;(&lt;/span&gt;&lt;span class="class0"&gt;typeof&lt;/span&gt;&lt;span class="class1"&gt; myLytebox==&lt;/span&gt;&lt;span class="class5"&gt;"undefined"&lt;/span&gt;&lt;span class="class1"&gt;) initLytebox();&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       myLytebox.start(a,&lt;/span&gt;&lt;span class="class0"&gt;false&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;and&lt;br /&gt;&lt;pre&gt;&lt;span class="class1"&gt;   ClientScript.RegisterStartupScript(GetType(), &lt;/span&gt;&lt;span class="class5"&gt;"mykey"&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class5"&gt;"MyOpenLytebox();"&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Still does not work. Neither does this&lt;br /&gt;&lt;pre&gt;&lt;span class="class1"&gt;ClientScript.RegisterStartupScript(GetType(), &lt;/span&gt;&lt;span class="class5"&gt;"&lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class5"&gt;mykey&lt;/span&gt;"&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;@"if (window.addEventListener != null) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;       window.addEventListener('load', &lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class1"&gt;MyOpenLytebox&lt;/span&gt;, false);&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;   else if (window.attachEvent != null) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;       window.attachEvent('onload', &lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class1"&gt;MyOpenLytebox&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;&lt;/span&gt;&lt;span class="class5"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;"&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I have guessed that in that case it is "double-initialized". Therefore I tried this&lt;br /&gt;&lt;pre&gt;&lt;span class="class1"&gt;ClientScript.RegisterStartupScript(GetType(), &lt;/span&gt;&lt;span class="class5"&gt;"&lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class5"&gt;mykey&lt;/span&gt;"&lt;/span&gt;&lt;span class="class1"&gt;,&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;@"if (window.addEventListener != null) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;       window.addEventListener('load', &lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class1"&gt;MyOpenLytebox&lt;/span&gt;, false);&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;   else if (window.attachEvent != null) {&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;       window.attachEvent('onload', &lt;/span&gt;&lt;span class="class5"&gt;&lt;span class="class1"&gt;MyOpenLytebox&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;       &lt;b&gt;window.detachEvent('onload',initLytebox);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;"&lt;/span&gt;&lt;span class="class1"&gt;, &lt;/span&gt;&lt;span class="class0"&gt;true&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;and that seem to work. Note that I detach the handler for IE only, it appears to work in Firefox without removeEventListener.&lt;br /&gt;&lt;br /&gt;Anyway, it was for a demo of LyteBox with Sharepoint and the boss decided to still use popups instead.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5359211435203874214?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5359211435203874214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/lytebox-from-windowonload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5359211435203874214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5359211435203874214'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/lytebox-from-windowonload.html' title='LyteBox from window.onload'/><author><name>val</name><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-4420197003505233862.post-7911118488607103637</id><published>2010-05-26T16:30:00.001-04:00</published><updated>2010-05-26T16:30:53.931-04:00</updated><title type='text'>Reporting Services Security</title><content type='html'>&lt;a href="http://technet.microsoft.com/en-us/library/bb283324.aspx"&gt;Security Overview for Reporting Services in SharePoint Integrated Mode&lt;/a&gt;&lt;br /&gt;Kerberos, Trusted Account, etc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7911118488607103637?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7911118488607103637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/reporting-services-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7911118488607103637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7911118488607103637'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/reporting-services-security.html' title='Reporting Services Security'/><author><name>val</name><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-4420197003505233862.post-846380713065546870</id><published>2010-05-19T23:39:00.000-04:00</published><updated>2010-05-26T16:29:04.518-04:00</updated><title type='text'>Reporting Services in Sharepoint Integrated Mode: An error occurred during client rendering. The remote server returned an error: (500) Internal Server Error</title><content type='html'>Banged my head the whole day today trying to figure out why I am getting the above error when trying to open SSRS report from Sharepoint. Turns out Report Viewer does not like anonymous access as mentioned &lt;a href="http://social.msdn.microsoft.com/Forums/en/sharepointbi/thread/f2766e74-16de-4ca0-910a-7d5bf8627086"&gt;here&lt;/a&gt;. Well, one more thing it does not like.&lt;br /&gt;&lt;br /&gt;UPD: In fact, it says so in &lt;a href="http://technet.microsoft.com/en-us/library/bb326290.aspx"&gt;Features Supported by Reporting Services in SharePoint Integrated Mode&lt;/a&gt; TechNet article: "&lt;i&gt;Report Server integration is not supported if the SharePoint Web application is enabled for Anonymous access.&lt;/i&gt;". The link is for SSRS 2008 R2 but I saw similar warning on the download page for Reporting 2005 Addin for Sharepoint.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-846380713065546870?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/846380713065546870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/error-occurred-during-client-rendering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/846380713065546870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/846380713065546870'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/error-occurred-during-client-rendering.html' title='Reporting Services in Sharepoint Integrated Mode: An error occurred during client rendering. The remote server returned an error: (500) Internal Server Error'/><author><name>val</name><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-4420197003505233862.post-7851135338632890550</id><published>2010-05-18T18:13:00.000-04:00</published><updated>2010-06-15T23:26:35.193-04:00</updated><title type='text'>How to wrap a user control in a web part</title><content type='html'>&lt;b&gt;&lt;span style="background-color: white; color: #4f81bd; font-family: Cambria; font-size: 13pt;"&gt;The approach&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Create an assembly that contains a web part class and a code behind for the control. Deploy assembly to the GAC and deploy the ascx to CONTROLTEMPLATES folder which is accessible as /_controltemplates virtual path from all sites. In the CreateChildControls method of the web part use Page.LoadControl method to load the ascx from the _controltemplates.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Also see &lt;a href="http://msdn.microsoft.com/en-us/library/ee413937.aspx"&gt;http://msdn.microsoft.com/en-us/library/ee413937.aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="background-color: white; color: #4f81bd; font-family: Cambria; font-size: 13pt;"&gt;Prerequisites&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Install WSPBuilder &lt;a href="http://wspbuilder.codeplex.com/"&gt;http://wspbuilder.codeplex.com/&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="background-color: white; color: #4f81bd; font-family: Cambria; font-size: 13pt;"&gt;Development&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;1.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Create a web application project. Let&lt;/span&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;s call it WebPartTest.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;2.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Remove all files added to the project: Default.aspx, web.config, etc&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;3.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Open project properties, select Signing tab and make sure the assembly is signed&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_9173_HUvI4c/S_2hmf4Q88I/AAAAAAAAAP0/YaLyqkqJ6L4/s1600/sign.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="363" src="http://1.bp.blogspot.com/_9173_HUvI4c/S_2hmf4Q88I/AAAAAAAAAP0/YaLyqkqJ6L4/s640/sign.GIF" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;4.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Get the public key token of the strong name. E.g. for the above case build the project, open command prompt, cd to the folder where the project is located and run &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Sn &lt;/span&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;-T bin/WebPartTest.dll&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;5.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Add new user control. Let&lt;/span&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;s call it WebPartUserControl.ascx&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;6.&lt;/span&gt;    &lt;span style="background-color: white; font-family: Calibri; font-size: 11pt;"&gt;Open the ascx and change the class information to the fully qualified name using the key token obtained above, e.g&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="highlight"&gt;&amp;lt;%&lt;/span&gt;&lt;span class="blue"&gt;@&lt;/span&gt; &lt;span class="tag"&gt;Control&lt;/span&gt; &lt;span class="red"&gt;Language&lt;/span&gt;&lt;span class="blue"&gt;="C#"&lt;/span&gt; &lt;span class="red"&gt;AutoEventWireup&lt;/span&gt;&lt;span class="blue"&gt;="true"&lt;/span&gt;&lt;span class="red"&gt; CodeBehind&lt;/span&gt;&lt;span class="blue"&gt;="WebPartUserControl.ascx.cs"&lt;/span&gt; &lt;span class="red"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="red"&gt;Inherits&lt;/span&gt;&lt;span class="blue"&gt;="WebPartTest.WebPartUserControl,WebPartTest, Version=1.0.0.0,&lt;br /&gt;Culture=neutral, PublicKeyToken=1cf72ca51010912c"&lt;/span&gt; &lt;span class="highlight"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;While you&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;re at it, add some content to the user control, but do not go overboard for now, this is a test project so far.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;7.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;If you plan on using Sharepoint APIs, then add reference to Microsoft.Sharepoint assembly. It is usually located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI. It is not needed for this sample though.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;8.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Add new code file to the assembly, let&lt;/span&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;s call it WebPartTest.cs. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;9.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Add the following code&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;using&lt;/span&gt;&lt;span class="class1"&gt; System;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;using&lt;/span&gt;&lt;span class="class1"&gt; System.Web.UI;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;using&lt;/span&gt;&lt;span class="class1"&gt; System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="class0"&gt;namespace&lt;/span&gt;&lt;span class="class1"&gt; WebPartTest&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;   public&lt;/span&gt; &lt;span class="class0"&gt;class&lt;/span&gt; &lt;span class="class4"&gt;WebPartTest&lt;/span&gt;&lt;span class="class1"&gt; : System.Web.UI.WebControls.WebParts.&lt;/span&gt;&lt;span class="class4"&gt;WebPart&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;    {&lt;/span&gt;&lt;br /&gt; &lt;span class="class0"&gt;      public&lt;/span&gt;&lt;span class="class1"&gt; WebPartTest()&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       &lt;span class="class0"&gt; protected&lt;/span&gt; &lt;span class="class0"&gt;override&lt;/span&gt; &lt;span class="class0"&gt;void&lt;/span&gt;&lt;span class="class1"&gt; CreateChildControls()&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       {&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;base&lt;/span&gt;&lt;span class="class1"&gt;.CreateChildControls();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;           &lt;span class="class4"&gt;Control&lt;/span&gt;&lt;span class="class1"&gt; ctrl = &lt;/span&gt;&lt;span class="class0"&gt;null&lt;/span&gt;&lt;span class="class1"&gt;;&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;string&lt;/span&gt;&lt;span class="class1"&gt; msg = &lt;/span&gt;&lt;span class="class4"&gt;String&lt;/span&gt;&lt;span class="class1"&gt;.Empty;&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;             ctrl = Page.LoadControl(&lt;/span&gt;&lt;span class="class5"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="class5"&gt;                 "/_controltemplates/WebPartTest/UserControls/WebPartUserControl.ascx"&lt;/span&gt;&lt;span class="class1"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          }&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;catch&lt;/span&gt;&lt;span class="class1"&gt; (&lt;/span&gt;&lt;span class="class4"&gt;Exception&lt;/span&gt;&lt;span class="class1"&gt; ex)&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;              msg = ex.ToString();&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          }&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;if&lt;/span&gt;&lt;span class="class1"&gt; (ctrl != &lt;/span&gt;&lt;span class="class0"&gt;null&lt;/span&gt;&lt;span class="class1"&gt;) Controls.Add(ctrl);&lt;/span&gt;&lt;br /&gt;           &lt;span class="class0"&gt;else&lt;/span&gt;&lt;span class="class1"&gt; Controls.Add(&lt;/span&gt;&lt;span class="class0"&gt;new&lt;/span&gt; &lt;span class="class4"&gt;Label&lt;/span&gt;&lt;span class="class1"&gt;()&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          {&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;              Text = &lt;/span&gt;&lt;span class="class5"&gt;"Failed to load control "&lt;/span&gt;&lt;span class="class1"&gt; + msg,&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;              ID = &lt;/span&gt;&lt;span class="class5"&gt;"lblMessage"&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;          });&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span class="class1"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;10.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Note the &lt;/span&gt;&lt;b&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;virtual&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt; path used to load the control and the initial slash.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;11.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Add a file WebPartTest.webpart with the following content. Change the public key token to the one you obtained in step 4&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="class5"&gt;xml&lt;/span&gt; &lt;span class="class6"&gt;version&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;1.0&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;encoding&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;utf-8&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;webParts&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;webPart&lt;/span&gt; &lt;span class="class6"&gt;xmlns&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;http://schemas.microsoft.com/WebPart/v3&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;metaData&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;     &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;type&lt;/span&gt; &lt;span class="class6"&gt;name&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest.WebPartTest,WebPartTest, Version=1.0.0.0, Culture=neutral,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;             PublicKeyToken=1cf72ca51010912c&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;     &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;importErrorMessage&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;span class="class1"&gt;Cannot import WebPartTest Web Part.&lt;/span&gt;&lt;span class="class0"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;importErrorMessage&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;metaData&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;webPart&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;webParts&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;12.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Add a file WebPartTest.xml with the following content. &lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="class5"&gt;xml&lt;/span&gt; &lt;span class="class6"&gt;version&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;1.0&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;encoding&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;utf-8&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;Elements&lt;/span&gt; &lt;span class="class6"&gt;xmlns&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;Module&lt;/span&gt; &lt;span class="class6"&gt;Name&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartPopulation&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Url&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;_catalogs/wp&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;RootWebOnly&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;TRUE&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Path&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebParts&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;File&lt;/span&gt; &lt;span class="class6"&gt;Url&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest.webpart&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Type&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;GhostableInLibrary&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;IgnoreIfAlreadyExists&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;True&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;File&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;Module&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;Elements&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;13.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Create the feature.xml file with the following content. Replace the GUID with a new one&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="class0"&gt;&amp;lt;!--&lt;/span&gt;&lt;span class="class3"&gt; change the GUID! &lt;/span&gt;&lt;span class="class0"&gt;--&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;Feature&lt;/span&gt; &lt;span class="class6"&gt;Title&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Id&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;10835FDF-96C1-4f6a-A894-56D8AEDC9BB9&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="class6"&gt;        Description&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Version&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;1.0.0.0&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Scope&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;Site&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;Hidden&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;FALSE&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&amp;nbsp;&lt;br /&gt;&lt;span class="class6"&gt;        DefaultResourceFile&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;core&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt; &lt;span class="class6"&gt;xmlns&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;ElementManifests&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;ElementManifest&lt;/span&gt; &lt;span class="class6"&gt;Location&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest.xml&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;   &amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;ElementFile&lt;/span&gt; &lt;span class="class6"&gt;Location&lt;/span&gt;&lt;span class="class0"&gt;=&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt;WebPartTest.webpart&lt;/span&gt;&lt;span class="class1"&gt;"&lt;/span&gt;&lt;span class="class0"&gt; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt; &amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;ElementManifests&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;Feature&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;14.&lt;/span&gt;    &lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Add solutionid.txt file to the project. It should contain one line of text with a new GUID which will become the solution GUID&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Now the project should look like this.&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_9173_HUvI4c/S_2hkeffIBI/AAAAAAAAAPs/ItGmHNL1xss/s1600/project.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_9173_HUvI4c/S_2hkeffIBI/AAAAAAAAAPs/ItGmHNL1xss/s320/project.GIF" width="304" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #4f81bd; font-family: Cambria; font-size: 13pt;"&gt;Build&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Right-click the project and from WSPBuilder menu choose Build. That will create .wsp package at the folder where the project file is located&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #4f81bd; font-family: Cambria; font-size: 13pt;"&gt;Deployment&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Assuming you still have the command prompt above open. For the first time deployment run the following&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;stsadm -o addsolution -filename webparttest.wsp&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;If you are upgrading the solution then run &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;stsadm -o upgradesolution -name WebPartTest.wsp -filename webparttest.wsp -immediate &lt;/span&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;-allowGacDeployment&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;This will schedule the upgrade in the next minute.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;The above will install the solution in the SP Farm. To deploy it to individual web site, open SP Administration and go to Operations. Under Global Configuration click Solution Management. Find the solution and deploy it. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Then to add the web part to the site you have deployed the solution to, open Site Settings, under Galleries click Web Parts. On the following page click New, locate WebPartTest assembly, check the check box next to it and click Update Galleries.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;Now open any page on the site, go into edit mode, locate the web part and try adding it to the page.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; font-size: 11pt;"&gt;TODO: Most of this can actually be generated by WSPBuilder. Need to update this post to reflect that &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7851135338632890550?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7851135338632890550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/06/how-to-wrap-user-control-in-web-part.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7851135338632890550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7851135338632890550'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/06/how-to-wrap-user-control-in-web-part.html' title='How to wrap a user control in a web part'/><author><name>val</name><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/_9173_HUvI4c/S_2hmf4Q88I/AAAAAAAAAP0/YaLyqkqJ6L4/s72-c/sign.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-5275762356137026713</id><published>2010-05-17T21:26:00.001-04:00</published><updated>2010-07-10T00:49:45.931-04:00</updated><title type='text'>ReportViewer control and SSRS in Sharepoint integrated mode</title><content type='html'>&lt;pre&gt;&lt;p&gt;&lt;span class="class0"&gt;&amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;rsweb&lt;/span&gt;&lt;span class="class0"&gt;:&lt;/span&gt;&lt;span class="class5"&gt;ReportViewer&lt;/span&gt; &lt;span class="class6"&gt;ID&lt;/span&gt;&lt;span class="class0"&gt;="ReportViewer1"&lt;/span&gt; &lt;span class="class6"&gt;runat&lt;/span&gt;&lt;span class="class0"&gt;="server"&lt;/span&gt; &lt;span class="class6"&gt;ProcessingMode&lt;/span&gt;&lt;span class="class0"&gt;="Remote"&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class0"&gt;&amp;lt;&lt;/span&gt;&lt;span class="class5"&gt;ServerReport&lt;/span&gt; &lt;span class="class6"&gt;ReportPath&lt;/span&gt;&lt;span class="class0"&gt;="http://server/Report.rdl"&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="class6"&gt;ReportServerUrl&lt;/span&gt;&lt;span class="class0"&gt;="http://server/_vti_bin/ReportServer"&lt;/span&gt; &lt;span class="class0"&gt;/&amp;gt;&lt;/span&gt; &lt;br /&gt;&lt;span class="class0"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="class5"&gt;rsweb&lt;/span&gt;&lt;span class="class0"&gt;:&lt;/span&gt;&lt;span class="class5"&gt;ReportViewer&lt;/span&gt;&lt;span class="class0"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5275762356137026713?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5275762356137026713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/reportviewer-control-and-ssrs-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5275762356137026713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5275762356137026713'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/reportviewer-control-and-ssrs-in.html' title='ReportViewer control and SSRS in Sharepoint integrated mode'/><author><name>val</name><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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4420197003505233862.post-3099606296862459322</id><published>2010-05-17T21:18:00.000-04:00</published><updated>2010-05-26T17:15:15.613-04:00</updated><title type='text'>UpdatePanel and SharePoint</title><content type='html'>UpdatePanel seem to work fine on an aspx page deployed to template/layouts. I had to register ASP.Net AJAX controls as Safe as described &lt;a href="http://www.jamestsai.net/Blog/post/How-To-Create-AJAX-enabled-SharePoint-Web-Part-with-UpdatePanel-and-UpdateProgress-in-10-minutes.aspx"&gt;here&lt;/a&gt; (Just get SPWebConfig_XML.zip from &lt;a href="http://www.moss2007.be/blogs/vandest/archive/2008/10/03/spwebconfigmodification-without-hardcoding-the-modifications.aspx"&gt;here&lt;/a&gt;, build and deploy). &lt;br /&gt;&lt;br /&gt;Also I had to reference System.Web.Extensions on the page itself because I did not want to modify web.config (after all it is a shared page). Like this&lt;br /&gt;&lt;pre&gt;&lt;p&gt;&lt;span class="highlight"&gt;&amp;lt;%&lt;/span&gt;&lt;span class="blue"&gt;@&lt;/span&gt; &lt;span class="tag"&gt;Register&lt;/span&gt; &lt;span class="red"&gt;assembly&lt;/span&gt;&lt;span class="blue"&gt;="System.Web.Extensions, Version=3.5.0.0, Culture=neutral,&lt;/span&gt;&lt;br /&gt;&lt;span class="blue"&gt;      PublicKeyToken=31BF3856AD364E35"&lt;/span&gt; &lt;span class="red"&gt;Namespace&lt;/span&gt;&lt;span class="blue"&gt;="System.Web.UI"&lt;/span&gt; &lt;span class="red"&gt;TagPrefix&lt;/span&gt;&lt;span class="blue"&gt;="asp"&lt;/span&gt;&lt;span class="highlight"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;Other than that nothing unusual - add ScriptManager and add UpdatePanel.&lt;br /&gt;&lt;br /&gt;UPD: In fact, ReportViewer, being AJAXy and all, screws up UpdatePanel badly. Here's the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/3c555eb9-6bc2-4155-8233-67462d45fdd1"&gt;link &lt;/a&gt;where it was said that ReportViewer is not compatible with UpdatePanel. &lt;a href="http://stackoverflow.com/questions/159391/reportviewer-control-and-ajax-updatepanel"&gt;Rumor&lt;/a&gt; has it, though, that it is fixed in 2010&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-3099606296862459322?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/3099606296862459322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/updatepanel-and-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3099606296862459322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/3099606296862459322'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/updatepanel-and-sharepoint.html' title='UpdatePanel and SharePoint'/><author><name>val</name><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-4420197003505233862.post-8183701447751088480</id><published>2010-05-17T21:07:00.000-04:00</published><updated>2010-05-17T21:11:01.803-04:00</updated><title type='text'>Session State and SharePoint</title><content type='html'>- There's this MSDN article titled "Session state cannot be used in ASP.NET with Windows SharePoint Services" &lt;a href="http://support.microsoft.com/kb/837376"&gt;http://support.microsoft.com/kb/837376&lt;/a&gt;&lt;br /&gt;- The exception "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive" is actually thrown by Page.get_Session property. Therefore use HttpContext.Current.Session!=null to check if session state is enabled instead of Session property.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8183701447751088480?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8183701447751088480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/session-state-and-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8183701447751088480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8183701447751088480'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/session-state-and-sharepoint.html' title='Session State and SharePoint'/><author><name>val</name><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-4420197003505233862.post-1062534931828003570</id><published>2010-05-17T20:47:00.000-04:00</published><updated>2010-05-17T20:54:44.616-04:00</updated><title type='text'>Sys.WebForms.PageRequestManagerParserErrorException</title><content type='html'>Sys.WebForms.PageRequestManagerParserErrorException when using UpdatePanel in SharePoint web page might be actually caused by some other exception. E.g. if an exception occurs during AJAX request processing then the response will contain something like the "Unknown Error" page which is not at all what UpdatePanel expects. Hence the error. So get rid of the UpdatePanel temporarily and see how the page behaves.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1062534931828003570?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1062534931828003570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/syswebformspagerequestmanagerparsererro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1062534931828003570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1062534931828003570'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/syswebformspagerequestmanagerparsererro.html' title='Sys.WebForms.PageRequestManagerParserErrorException'/><author><name>val</name><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-4420197003505233862.post-5394520087172616551</id><published>2010-05-05T11:50:00.000-04:00</published><updated>2010-05-05T12:40:05.489-04:00</updated><title type='text'>SharePointSmart404 's ApplyWebconfigModifications</title><content type='html'>SharePointSmart404 project adds a Site-scoped feature which has a feature receiver that modifies web.config file adding an httpmodule entry during feature activation. web.config is specific to WebApplication rather than a Site or SiteCollection. Now, let's say I have two site collections in the same application. &lt;br /&gt;1. I deploy the solution. No modifications are made to web.config at this point&lt;br /&gt;2. Activate the feature for first site collection. This adds the entry for httpmodule to the web.config&lt;br /&gt;3. Activate the feature for the second site collection. Because the Name property of the SPWebModification is set appropriately, that does not add a second entry for the same httpmodule. That's a good thing.&lt;br /&gt;&lt;br /&gt;What happens if I deactivate the features depends on whether the feature receiver contains code to remove the entry it has added.&lt;br /&gt;&lt;br /&gt;4a. There's no code to remove the entry&lt;br /&gt;    4a.1 Deactivate the feature for the second site collection. The httpmodule entry is not removed&lt;br /&gt;    4a.2 Deactivate the feature for the first site collection. The entry is still there and that is a bad thing because we now have active HttpModule which will execute despite the feature not being active&lt;br /&gt;&lt;br /&gt;4b. There is a code to remove the entry&lt;br /&gt;    4b.1 Deactivate the feature for the second site collection. The entry for httpmodule is removed. That is also a bad thing since the feature is still active for the first site collection but it will not operate properly since the HttpModule is no longer configured.&lt;br /&gt;&lt;br /&gt;The solution:&lt;br /&gt;Add another WebApplication-scoped feature. Put the code that modifies web.config to the receiver of this feature. Add an ActivationDependency to the Site-scoped feature to require WebApplication's feature to be activated before Site's feature is activated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-5394520087172616551?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/5394520087172616551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/sharepointsmart404-s.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5394520087172616551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/5394520087172616551'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/sharepointsmart404-s.html' title='SharePointSmart404 &apos;s ApplyWebconfigModifications'/><author><name>val</name><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-4420197003505233862.post-1133236647595236201</id><published>2010-05-04T17:53:00.000-04:00</published><updated>2010-05-04T17:58:59.185-04:00</updated><title type='text'>Problem with SPFeatureReceiver</title><content type='html'>Spent better half of the day figuring out why I am getting this error about SPFeatureReciever while trying to deploy Sharepoint solution:&lt;br /&gt;&lt;br /&gt;Failed to create feature receiver object from assembly "HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=...", type "HelloWorld.FeatureReciever" for feature &lt;GUID&gt;: System.ArgumentNullException: Value cannot be null.&lt;br /&gt;&lt;br /&gt;Parameter name: type&lt;br /&gt;   at System.Activator.CreateInstance(Type type, Boolean nonPublic)&lt;br /&gt;   at System.Activator.CreateInstance(Type type)&lt;br /&gt;   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()&lt;br /&gt;&lt;br /&gt;Amazingly, it worked fine in single server environment but failed with the above error on the farm. Even more, the solution deployed successfully on one server in the farm but failed on the other. Yet even more, it randomly failed on either of the servers and succeeded on the other. &lt;br /&gt;&lt;br /&gt;Long story short, the solution - increment the AssemblyVersion in AssemblyInfo.cs and everywhere where it is referenced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-1133236647595236201?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/1133236647595236201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/05/problem-with-spfeaturereceiver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1133236647595236201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/1133236647595236201'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/05/problem-with-spfeaturereceiver.html' title='Problem with SPFeatureReceiver'/><author><name>val</name><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-4420197003505233862.post-7927287722520468937</id><published>2010-03-15T14:55:00.001-04:00</published><updated>2010-03-15T14:57:29.728-04:00</updated><title type='text'>Sharepoint web part properties</title><content type='html'>No matter what I do, the properties specified under webparts/webpart/properties element in the .webpart file are not present when I try to add deployed (via wsp package) web part to the gallery. I can upload the web part to the gallery and then the properties will show up. They will also be present for lower level sites.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-7927287722520468937?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/7927287722520468937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/03/sharepoint-web-part-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7927287722520468937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/7927287722520468937'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/03/sharepoint-web-part-properties.html' title='Sharepoint web part properties'/><author><name>val</name><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-4420197003505233862.post-865207950851247920</id><published>2010-03-15T11:25:00.000-04:00</published><updated>2010-03-15T11:27:30.186-04:00</updated><title type='text'>How to get to web part maintenance page</title><content type='html'>Append the querystring ?contents=1 to the url in the browser as shown below.&lt;br /&gt;&lt;span style="font-size:x-small"&gt;From &lt;a href=""&gt;here&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-865207950851247920?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/865207950851247920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/03/how-to-get-to-web-part-maintenance-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/865207950851247920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/865207950851247920'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/03/how-to-get-to-web-part-maintenance-page.html' title='How to get to web part maintenance page'/><author><name>val</name><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-4420197003505233862.post-886423145240274926</id><published>2010-03-04T22:32:00.000-05:00</published><updated>2010-03-04T22:38:52.436-05:00</updated><title type='text'>Sansa Fuse headphone jack</title><content type='html'>Recently the headphone jack on my Sansa Fuse mp3 player started acting up - the left channel disappeared every now and then. Which was especially annoying while running. Well, it finally annoyed me enough. I opened it up by carefully picking with a thin screwdriver at the sides and then resoldered the middle leads of the jack to the PCB. There were no visible damage, just a poor solder I guess. Closed it up and it works fine again right now! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-886423145240274926?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/886423145240274926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/03/sansa-fuse-headphone-jack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/886423145240274926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/886423145240274926'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/03/sansa-fuse-headphone-jack.html' title='Sansa Fuse headphone jack'/><author><name>val</name><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-4420197003505233862.post-9025629303786856094</id><published>2010-01-07T16:57:00.000-05:00</published><updated>2010-01-07T17:04:53.450-05:00</updated><title type='text'>How to add “Add Controller” / “Add View” menus in a hybrid MVC/WebForms ASP.NET application</title><content type='html'>Recently I wanted to add a couple new pages to a Web Forms ASP.Net application and decided to implement them using ASP.Net MVC. It is trivial to mix MVC and Web Forms. However, I missed the “Add Controller” / “Add View” context menus.&lt;br /&gt;&lt;br /&gt;To get them in a Web Forms application, open the project file, .csproj,  in a text editor. Locate the &lt;projecttypeguids&gt; element &amp;lt;ProjectTypeGuids&amp;gt; and add this guid {603c0e0b-db56-11dc-be95-000d561079b0}; to its contents. Save the file and reload the project in the VS. The menus seem to appear only on top-level folders named Controllers and Views respectively.&lt;/projecttypeguids&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-9025629303786856094?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/9025629303786856094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2010/01/how-to-add-add-controller-add-view.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9025629303786856094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/9025629303786856094'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2010/01/how-to-add-add-controller-add-view.html' title='How to add “Add Controller” / “Add View” menus in a hybrid MVC/WebForms ASP.NET application'/><author><name>val</name><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-4420197003505233862.post-8686740883548103812</id><published>2009-12-20T19:24:00.000-05:00</published><updated>2009-12-20T20:26:23.920-05:00</updated><title type='text'>Servers</title><content type='html'>I'm reading (again) about Separation of Concerns principle in Architecting MS Solutions and it makes me think again why I always wanted to have a separate application server, workstation and a file/backup server at home. Clearly, to adhere to the SoC, you better separate the three. On the other hand, and this always stopped me, that means that I would need 2 servers, I would need to buy them, put them somewhere, either concern myself with wasting electricity or figure out how to power them on and shut them down conveniently.&lt;br /&gt;&lt;br /&gt;But, not having them actually means:&lt;br /&gt;- not really having an up to date back up, despite some efforts&lt;br /&gt;- not having a trashable playground&lt;br /&gt;- not having a central storage area, which makes locating data complicated (i.e. where the hell was that DVD?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-8686740883548103812?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/8686740883548103812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2009/12/servers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8686740883548103812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/8686740883548103812'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2009/12/servers.html' title='Servers'/><author><name>val</name><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-4420197003505233862.post-4852687365067772172</id><published>2009-12-20T02:21:00.003-05:00</published><updated>2011-08-26T14:32:20.887-04:00</updated><title type='text'>TortoiseSVN on Windows</title><content type='html'>Set up subversion with Apache with Windows authentication as described at &lt;a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-apache.html"&gt;http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup-apache.html&lt;/a&gt;&lt;br /&gt;However, Tortoise kept prompting me for credentials. Then I found &lt;a href="http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&amp;amp;dsMessageId=1045414"&gt;this&lt;/a&gt; post, which suggested to change &lt;span style="font-style: italic;"&gt;SSPIPerRequestAuth&lt;/span&gt; to &lt;span style="font-style: italic;"&gt;Off&lt;/span&gt;. That fixed it for me.&lt;br /&gt;&lt;br /&gt;The error message "foo is a subdirectory of existing repository rooted at bar" from &lt;span style="font-style: italic;"&gt;svnadmin create&lt;/span&gt; may actually mean that a) the directory already exists and is not empty; b) that svnadmin does not like slashes at the end of specified path.&lt;br /&gt;&lt;br /&gt;The 301 Moved permanently error, resulting in "Repository moved permanently, please relocate" may be caused by virtual directories layout, as explained &lt;a href="http://subversion.tigris.org/faq.html#http-301-error"&gt;here&lt;/a&gt;. In my case, I changed the &lt;span style="font-style: italic;"&gt;SVNParentPath &lt;/span&gt;&lt;span style="font-style: italic;"&gt;My Documents/SVN&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;SVNPath &lt;/span&gt;&lt;span style="font-style: italic;"&gt;My Documents/SVN&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;because all I want is a single repository.&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;UPD: trying to do that the second time, I don't want to forget this:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;- &lt;/span&gt;Apache complains&lt;span style="font-style: italic;"&gt; "Cannot load module modules/mod_authz_svn.so: module cannot be found". &lt;/span&gt;Add Subversion/bin to the PATH &lt;b&gt;and&lt;/b&gt; specify the full path (&lt;span style="font-size: x-small;"&gt;&lt;i&gt;"C:/Program Files/Subversion/bin/mod_dav_svn.so"&lt;/i&gt;&lt;/span&gt;) to SVN modules in httpd.conf. No need to copy them to Apache/bin. &lt;br /&gt;&lt;span style="font-style: italic;"&gt;- &lt;/span&gt;make sure there's no Listen setting in httpd.conf. I want it to use https only and https port is configured in &lt;i&gt;conf/extra/httpd-ssl.conf&lt;/i&gt; which you need to include by uncommenting relevant line in httpd.conf&lt;br /&gt;- the script to create certificate (save it in a .bat file)&lt;br /&gt;&lt;span style="font-style: italic;"&gt;bin\openssl req -config conf\openssl.cnf -new -out my-server.csr&lt;br /&gt;bin\openssl genrsa -out conf\privkey.pem 2048&lt;br /&gt;bin\openssl rsa -in conf\privkey.pem -out conf\server.key&lt;br /&gt;bin\openssl req -new -key conf\server.key -out conf\server.csr -config conf\openssl.cnf&lt;br /&gt;bin\openssl x509 -in conf\server.csr -out conf\server.crt -req -signkey conf\server.key -days 4000&lt;br /&gt;bin\openssl x509 -in conf\server.crt -out conf\server.der.crt -outform DER&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;UPD: See &lt;a href=""&gt;here&lt;/a&gt; regarding error&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Syntax error on line 62 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf:&lt;br /&gt;SSLSessionCache: Invalid argument: size has to be &gt;= 8192 bytes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Basically, change the following  &lt;br /&gt;SSLSessionCache "shmcb:c:/Users/myusername/Apache/Apache2.2/logs/ssl_scache(512000)"&lt;br /&gt;to&lt;br /&gt;SSLSessionCache "shmcb:C:/PROGRA\~2/Apache Software Foundation/Apache2.2/logs/ssl_scache(512000)"&lt;br /&gt;in httpd-ssl.conf&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4420197003505233862-4852687365067772172?l=vkirshin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vkirshin.blogspot.com/feeds/4852687365067772172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vkirshin.blogspot.com/2009/12/tortoisesvn-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4852687365067772172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4420197003505233862/posts/default/4852687365067772172'/><link rel='alternate' type='text/html' href='http://vkirshin.blogspot.com/2009/12/tortoisesvn-on-windows.html' title='TortoiseSVN on Windows'/><author><name>val</name><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>
