<?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-136372299889916108</id><updated>2012-02-09T22:22:01.505-05:00</updated><category term='Case Insensitive'/><category term='Windows XP'/><category term='Custom Field Type'/><category term='Automatic Logon'/><category term='Feature'/><category term='MOSS 2007'/><category term='SPWebConfigModification'/><category term='DataView Web Part'/><category term='Automatic Authentication'/><category term='SharePoint'/><category term='AJAX'/><category term='List Input Forms'/><category term='.NET Framework 3.5 SP1'/><category term='Cascading DropDownList'/><category term='WSS 3.0'/><category term='C#'/><category term='Forms Server'/><category term='InfoPath 2007'/><category term='SharePoint Designer'/><category term='Property Promotion'/><category term='Conditional Formatting'/><category term='Access Denied'/><category term='Remote Desktop Connection'/><category term='Contact Selector Control'/><category term='Internet Explorer'/><category term='Master Pages'/><category term='Security Settings'/><category term='JavaScript'/><category term='Field Comparison'/><category term='Windows Server 2003'/><category term='InfoPath'/><title type='text'>Andrew Richter's Professional Blog</title><subtitle type='html'>Technological musings and ramblings, which currently revolve around SharePoint.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-6854938027953228849</id><published>2009-02-13T17:57:00.000-05:00</published><updated>2009-02-13T17:57:21.834-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='List Input Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>Correction - Customized Input Forms: The JavaScript Approach</title><content type='html'>Previously I posted about my method for &lt;a href="http://arichterwork.blogspot.com/2008/07/customized-input-forms-javascript.html"&gt;customizing SharePoint list forms&lt;/a&gt; (NewForm.aspx, DispForm.aspx, EditForm.aspx).  Recently, an issue has come up with respect to this code and saving list items.&lt;br /&gt;&lt;br /&gt;If a user is modifying a list item, and they have disabled controls on the page (grayed out), then when they save the item, those disabled fields will revert to the default value specified for each of those columns.  The correct values populate on the page, but apparently the values stored within disabled controls do not get returned to the server upon the form being submitted.&lt;br /&gt;&lt;br /&gt;I have come up with a quick solution (not sure if it is the best at this moment), but it allows for the values to be returned to the server by re-enabling all of the disabled fields just before the form is submitted.  Only problem so far is that if the page takes a while to submit, the fields appear to be editable to the user, even though changes made won't actually be sent to the server.&lt;br /&gt;&lt;br /&gt;Please see this link for a reference to the function &lt;b&gt;PreSaveAction()&lt;/b&gt;: &lt;a href="http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html" target="_blank"&gt;Add JavaScript Date Validation into List Item forms&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Updated code (new code added is highlighted in yellow): &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_16cqnxcmgw" target="_blank"&gt;CustomizedInputForms_JavaScriptFile&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-6854938027953228849?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/6854938027953228849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2009/02/correction-customized-input-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/6854938027953228849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/6854938027953228849'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2009/02/correction-customized-input-forms.html' title='Correction - Customized Input Forms: The JavaScript Approach'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-8916599278841045773</id><published>2009-02-13T17:35:00.006-05:00</published><updated>2009-02-19T14:35:36.156-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom Field Type'/><category scheme='http://www.blogger.com/atom/ns#' term='Cascading DropDownList'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>MOSS Cascading DropDownLists - The Sexy Approach - 2 of 2</title><content type='html'>&lt;b&gt;Disclaimer reiterated:  Do NOT copy/paste all of this code and deploy straight to a production environment.  I cannot stress this enough.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Link to previous post: &lt;a href="http://arichterwork.blogspot.com/2008/10/moss-cascading-dropdownlists-sexy.html"&gt;MOSS Cascading DropDownLists - The Sexy Approach - 1 of 2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Welcome to the second half of my discussion about AJAX Cascading DropDownLists within SharePoint 2007.  I apologize for not getting this posted earlier, but I've been swamped at work lately.  There is a lot of code involved, and I would like to thank the following people for various bits and pieces which I borrowed (&lt;a href="#cddl-pt-2-code"&gt;links to my code&lt;/a&gt; are at the bottom of the post):&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Todd Bleeker&lt;/b&gt;: Custom Field Control discussion at &lt;a href="http://www.sharepointbestpractices.com/" target="_blank"&gt;SharePoint Best Practice Conference 2007&lt;/a&gt;&lt;br /&gt;an extremely informative and helpful introduction to the various components of a custom field control&lt;/li&gt;&lt;li&gt;&lt;b&gt;DataCogs&lt;/b&gt;: &lt;a href="http://datacogs.com/datablogs/archive/2007/08/26/641.aspx" target="_blank"&gt;Sharepoint – Cascading Drop Down Lists&lt;/a&gt;&lt;br /&gt;an excellent example of a custom field control, especially one solving the same problem I was looking to solve&lt;/li&gt;&lt;li&gt;&lt;b&gt;Wouter van Vugt&lt;/b&gt;: &lt;a href="http://msdn.microsoft.com/en-us/library/cc889345.aspx" target="_blank"&gt;Creating a Windows SharePoint Services 3.0 Custom Field by Using the EntityPicker&lt;/a&gt;&lt;br /&gt;an excellent explanation of the problems associated with saving a new field control instance for the first time, and how to correctly save the properties.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;As the &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_7c7f2kcgk" target="_blank"&gt;manifest.xml&lt;/a&gt; and &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_8dw5b8wgs" target="_blank"&gt;wsp_structure.ddf&lt;/a&gt; files are pretty straightforward if you've worked with SharePoint Solution packages before, I will not discuss these.&lt;br /&gt;&lt;br /&gt;Here is a great walkthrough on the different elements required in creating a custom field type on MSDN: &lt;a href="http://msdn.microsoft.com/en-us/library/bb861799.aspx" target="_blank"&gt;Walkthrough: Creating a Custom Field Type&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;We'll start with the creation of the field type definition: &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_11g2vrpzcr" target="_blank"&gt;fldtypes_cascadingdropdownlist.xml&lt;/a&gt;.  This file is used to store the various configuration information related to your custom field type.  Multiple field types &lt;b&gt;can&lt;/b&gt; be defined within the same file, however, this is &lt;b&gt;not&lt;/b&gt; advised.  All of the fields at the top are standard custom field type definition attributes.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;TypeName&lt;/b&gt; is the internal name for this field type&lt;/li&gt;&lt;li&gt;&lt;b&gt;TypeDisplayName&lt;/b&gt; is what will be displayed on the "Create a new column" page&lt;/li&gt;&lt;li&gt;&lt;b&gt;FieldTypeClass&lt;/b&gt; is where you reference the assembly containing your field type class&lt;/li&gt;&lt;li&gt;&lt;b&gt;FieldEditorUserControl&lt;/b&gt; is the location of the ASCX file which defines the user interface for Custom Properties&lt;/li&gt;&lt;li&gt;&lt;b&gt;PropertySchema&lt;/b&gt; is used to define custom properties.&lt;br /&gt;All of my custom properties are simple TEXT fields, which have fixed length and are hidden.  This is so I can use other controls (like DropDownLists) for the creation of the column, to make selecting values easier on the user.  These custom properties are where I store which list supplies the data and how it is displayed/filtered.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;RenderPattern&lt;/b&gt; is not used in my solution.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The class and assembly referenced in the attribute &lt;b&gt;FieldTypeClass&lt;/b&gt; is used as the base class for storing/retrieving custom and default properties for this field type.  Please see the comments in &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_12hjnvk83x" target="_blank"&gt;CascadingDropDownList.cs&lt;/a&gt; for a more detailed breakdown of functionality.  I have opted to use the ThreadData method for storing values on initial column creation as mentioned previously in the &lt;a href="http://msdn.microsoft.com/en-us/library/cc889345.aspx"&gt;MSDN article&lt;/a&gt; by Wouter van Vugt.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_12hjnvk83x" target="_blank"&gt;CascadingDropDownList.cs&lt;/a&gt; near the bottom, I am using the custom class &lt;b&gt;CascadingDropDownListEditControl&lt;/b&gt; as the &lt;b&gt;RenderingControl&lt;/b&gt;.  The user control for this is incredibly simple: &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_9chwdcbg7" target="_blank"&gt;CascadingDropDownListEditControl.ascx&lt;/a&gt;.  It is just a normal DropDownList inside of a SharePoint RenderingTemplate.  The class file associated with this ASCX file is &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_13dpdbn8ft" target="_blank"&gt;CascadingDropDownListEditControl.cs&lt;/a&gt;.  There are a few key components of this class to note:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;ddlCascading.ContextKey&lt;/b&gt; is used to pass the necessary information to access a SharePoint list to the Web Service which will be populating the DropDownLists on the client side.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ddlCascading.ParentControlID&lt;/b&gt; has to be set at runtime, as this is the ID of the control on the page, not the value stored within the column's properties.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Render&lt;/b&gt; method is overridden to circumvent the necessity of disabling EventValidation for the CascadingDropDown extender to function.  This method obtains all possible values from the corresponding SharePoint lists, and registers them for event validation on the client side &lt;b&gt;(potential performance hit if you have significantly large value lists)&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ddlCascading.ServicePath&lt;/b&gt; is the location for the web service to pass the AJAX request to and &lt;b&gt;ddlCascading.ServiceMethod&lt;/b&gt; is the method invoked within the given Web Service.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This web service is defined within the files &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_5czkpxmcc" target="_blank"&gt;CascadingWebService.asmx&lt;/a&gt; and &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_15g3sfwndb" target="_blank"&gt;CascadingWebService.cs&lt;/a&gt;.  The ASMX file is very simple, with just a reference to the assembly containing the web service class.  Within the class, there are two functions: &lt;b&gt;GetListItemsPageMethod&lt;/b&gt; and &lt;b&gt;SortNameValuePair&lt;/b&gt;.  The name for &lt;b&gt;GetListItemsPageMethod&lt;/b&gt; can vary as long as it is the same here as it is in &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_13dpdbn8ft" target="_blank"&gt;CascadingDropDownListEditControl.cs&lt;/a&gt; for &lt;b&gt;ddlCascading.ServiceMethod&lt;/b&gt;.  However, the *signature* for this method must be exactly as displayed.  The &lt;b&gt;contextKey&lt;/b&gt; at the end is optional (if you don't have to supply additional information for the AJAX request), but the rest of the parameters, as well as the security modifier and return type must be the same as I've used.  &lt;b&gt;SortNameValuePair&lt;/b&gt;, on the other hand, is a custom function I created to allow for sorting the collection of &lt;b&gt;CascadingDropDownNameValue&lt;/b&gt;s, since &lt;b&gt;List.Sort&lt;/b&gt; does not know how the name-value pairs should be compared.&lt;br /&gt;&lt;br /&gt;And the final component to this solution is the Properties class for the Cascading DropDownList.  The Properties class is used for defining the way in which custom list properties (specified within the field type definition &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_11g2vrpzcr" target="_blank"&gt;fldtypes_cascadingdropdownlist.xml&lt;/a&gt;) are displayed on the column creation/modification page.  Again, please reference the comments within &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_14hddhhxcm" target="_blank"&gt;CascadingDropDownListPropControl.cs&lt;/a&gt; for a description of what is happening.  It displays and modifies the custom column properties (which are defined as TEXT elements) using a Text Box, a Button, and several DropDownLists.  &lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_10frjvmdc9" target="_blank"&gt;CascadingDropDownListPropControl.ascx&lt;/a&gt; is a little more involved than the other ASCX files, but much of the HTML was simply to ensure that the properties for this custom field control looked like the properties for out-of-the-box field controls.&lt;br /&gt;&lt;br /&gt;For the Name/Value columns, the source SharePoint list needs to be established as follows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For each Cascading DropDownList you plan to have, you need a column to represent its potential values.&lt;/li&gt;&lt;li&gt;Be sure to enter all possible values for Parent, Child, Grandchild, etc within each list item&lt;/li&gt;&lt;li&gt;Here is a picture of my sample list: &lt;a href="http://picasaweb.google.com/lh/photo/rrRo5RBvY7W0yJQcp6xzmw?feat=directlink" target="_blank"&gt;Bird Classifications&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I tried to supply a lot of code, with the hope that it would be self-explanatory.  If you need further explanation of what is happening, or why I did it this way, please do not hesitate to comment below.  Here are some pictures of a sample implementation for Bird Sightings, using 3 Cascading DropDownLists (Family[Parent] -&gt; Genus[Child] -&gt; Species[Grandchild]):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/SEgTuc0hjKVtsWZL20ZfbQ?feat=directlink" target="_blank"&gt;Creating the Family Column - Entering a URL&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/yUfU9i-pWVg-EndROtUVmg?feat=directlink" target="_blank"&gt;Creating the Family Column - Choosing the SharePoint List which supplies values&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/V9r0ceO4iA9pQEIooVdXtA?feat=directlink" target="_blank"&gt;Creating the Family Column - After DropDownLists are populated&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/JKTW5LOQBL4fj6jD61Oknw?feat=directlink" target="_blank"&gt;Creating the Family Column - Selecting columns which provide text/values&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/uZdxdgtZNd_77EpIQfBJ-g?feat=directlink" target="_blank"&gt;Creating the Family Column - No Parent Fields Available&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/9WnJ5871IUnPQow-QeXGeg?feat=directlink" target="_blank"&gt;Creating the Family Column - Sorting Options&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/sGWX843p8vdsZYzwRMnDlw?feat=directlink" target="_blank"&gt;Creating the Genus Column - Choosing a Filter Column&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/KQjQp_5k-OIdYfdQwSyluw?feat=directlink" target="_blank"&gt;Creating the Genus Column - Choosing a Parent Column&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/Ki2L4E7n0TPfY2cQa707yA?feat=directlink" target="_blank"&gt;Creating the Species Column - Choosing a Parent Column&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/VL2oIg8NiqMQhGvznDLBdA?feat=directlink" target="_blank"&gt;Entering a List Item - Page Load 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/Lc45oEhwWBvSCmI7vIKdOQ?feat=directlink" target="_blank"&gt;Entering a List Item - Page Load 2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/kpR4WvwfOoECYgoXUeCmFQ?feat=directlink" target="_blank"&gt;Entering a List Item - Page Load 3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/zy4lfBbnhrheN8sXZr-JTQ?feat=directlink" target="_blank"&gt;Entering a List Item - Species Values&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/TFfCleyOk0iShPbqYfCeEw?feat=directlink" target="_blank"&gt;Entering a List Item - Selecting a Different Genus&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/dzxHKxs7DE4FUum_s3FQdw?feat=directlink" target="_blank"&gt;Entering a List Item - New Species Values&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://picasaweb.google.com/lh/photo/CcL9tm4Zcy5arjP6QUM_XA?feat=directlink" target="_blank"&gt;Slideshow of multiple DropDownLists in Action&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Limitations:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Cascading DropDownList controls must be displayed in order on the page, in the order you want their relationship to be (Parent before Child, and Child before Grandchild, etc.)  If the Child is before the Parent, then the Child control will not be able to find the Parent control on the page.&lt;/li&gt;&lt;li&gt;It is possible to modify the Parent field of a Cascading DropDownList to a control which appears lower on the form page.  The filtering of values in the "Parent Column" property only removes the current field.&lt;/li&gt;&lt;li&gt;If you have a Parent-&gt;Child-&gt;Grandchild relationship, and different Parent values have the same Child values in the source SharePoint list, then all of the potential Grandchildren for each Child will be visible if that Child is selected, regardless of which value is entered into Parent.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This control has already received widespread use within my organization.  If you have any recommendations on improvement to remove these limitations, I would love to hear about the modifications you have made to the below code.  I hope you enjoyed this deep-dive into employing the AjaxControlToolkit's CascadingDropDown within SharePoint using a Custom Field Control.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;br /&gt;&lt;a id="cddl-pt-2-code"&gt;&lt;/a&gt;&lt;br /&gt;Links to solution files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_7c7f2kcgk" target="_blank"&gt;manifest.xml&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_8dw5b8wgs" target="_blank"&gt;wsp_structure.ddf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_11g2vrpzcr" target="_blank"&gt;fldtypes_cascadingdropdownlist.xml&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_12hjnvk83x" target="_blank"&gt;CascadingDropDownList.cs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_10frjvmdc9" target="_blank"&gt;CascadingDropDownListPropControl.ascx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_14hddhhxcm" target="_blank"&gt;CascadingDropDownListPropControl.cs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_9chwdcbg7" target="_blank"&gt;CascadingDropDownListEditControl.ascx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_13dpdbn8ft" target="_blank"&gt;CascadingDropDownListEditControl.cs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_5czkpxmcc" target="_blank"&gt;CascadingWebService.asmx&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.google.com/Doc?id=dcsmfgs2_15g3sfwndb" target="_blank"&gt;CascadingWebService.cs&lt;/a&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/136372299889916108-8916599278841045773?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/8916599278841045773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2009/02/moss-cascading-dropdownlists-sexy.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/8916599278841045773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/8916599278841045773'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2009/02/moss-cascading-dropdownlists-sexy.html' title='MOSS Cascading DropDownLists - The Sexy Approach - 2 of 2'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-4373884791390858911</id><published>2008-12-09T14:56:00.018-05:00</published><updated>2009-02-17T18:43:50.299-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Custom Field Type'/><category scheme='http://www.blogger.com/atom/ns#' term='Cascading DropDownList'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='SPWebConfigModification'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Feature'/><category scheme='http://www.blogger.com/atom/ns#' term='List Input Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>MOSS Cascading DropDownLists - The Sexy Approach - 1 of 2</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Disclaimer: I recommend reviewing any/all code (including content that is linked to) and fully understanding what it does before deploying anything to your staging, test, and/or production environments. There is nothing worse than deploying code/solutions which cause critical errors that you don't know how to fix.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Link to next post: &lt;a href="http://arichterwork.blogspot.com/2009/02/moss-cascading-dropdownlists-sexy.html"&gt;MOSS Cascading DropDownLists - The Sexy Approach - 2 of 2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am really excited about this post for a number of reasons:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;AJAX makes things look really slick&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Cascading DropDownLists in SharePoint are a pain&lt;/li&gt;&lt;li&gt;I've finally finished this project!&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The task at hand was to implement Cascading DropDownLists within a standard SharePoint list (no InfoPath). Some resources that were immensely helpful while constructing this are as follows.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Regarding Custom Field Controls and Cascading DropDownLists:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Data Cogs - &lt;a href="http://datacogs.com/datablogs/archive/2007/08/26/641.aspx"&gt;SharePoint Cascading Drop Down Lists&lt;/a&gt;&lt;/li&gt;&lt;li&gt;MSDN - &lt;a href="http://msdn.microsoft.com/en-us/library/cc837956.aspx"&gt;Creating a Windows SharePoint Services 3.0 Custom Field by Using the EntityPicker&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Regarding AJAX integration with SharePoint:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Mike Ammerlaan - &lt;a href="http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3"&gt;Integrating ASP.NET AJAX with SharePoint&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Rich Finn - &lt;a href="http://www.codeplex.com/ajaxifymoss"&gt;Ajaxify MOSS&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The project consists of two solutions, one which configures the web.config with modifications to allow ASP.NET AJAX, and one which deploys an AJAX Cascading DropDownList custom field control. This post will cover the integration with AJAX. &lt;span style="font-style: italic;"&gt;My next post will cover the custom field control.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Prerequisites:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;You must have &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displaylang=en"&gt;.NET Framework 3.5 SP1&lt;/a&gt; installed on your server&lt;/li&gt;&lt;li&gt;You must add the &lt;a href="http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=16488"&gt;AjaxControlToolkit&lt;/a&gt; DLL to your VS solution&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;These are links to the four files (&lt;a href="https://docs.google.com/View?docid=dcsmfgs2_2hpckcrcr&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;Feature.xml&lt;/a&gt;, &lt;a href="https://docs.google.com/View?docid=dcsmfgs2_3rkz8qqcc&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;manifest.xml&lt;/a&gt;, &lt;a href="https://docs.google.com/View?docid=dcsmfgs2_4d42rb2g2&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;wsp_structure.ddf&lt;/a&gt;, &lt;a href="https://docs.google.com/View?docid=dcsmfgs2_0htj4hrhj&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;AjaxControlToolkitSupportInstaller.cs&lt;/a&gt;) which are necessary for the solution which enables AJAX on your web application. I have decided to host the files within my GoogleDocs account because I like color coded files, there is too much code to paste it into this blog window, and I don't feel like creating a CodePlex project to upload, maintain, track bugs, and such.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you are familiar at all with SharePoint Solution deployment, you will be right at home with manifest.xml and wsp_structure.ddf. I did not use any 3rd party tools for solution deployment. I used a simple C# class library with some custom batch files for processing the wsp_structure.ddf.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-weight: bold;"&gt;Please note:&lt;/span&gt;&amp;nbsp;&amp;nbsp;You *must* create two GUIDS: one for the solution, and one for the feature. Also, be sure to create your assembly with a strong name, and insert your PublicKeyToken into the Feature.xml file.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I took bits and pieces from both &lt;span style="font-weight: bold;"&gt;Rich Finn&lt;/span&gt;'s CodePlex project and &lt;span style="font-weight: bold;"&gt;Mike Ammerlaan&lt;/span&gt;'s blog to create this feature. However, I really liked the way that &lt;span style="font-weight: bold;"&gt;Ted Pattison&lt;/span&gt; implemented a &lt;span style="color: #6fa8dc;"&gt;SPWebConfigModification&lt;/span&gt; feature in his post &lt;a href="http://blog.tedpattison.net/Lists/Posts/Post.aspx?ID=4"&gt;Using a Web Application Feature to Modify web.config&lt;/a&gt;, so instead of Ajaxify MOSS's command line approach, this is entirely browser based, and activated/deactivated within Central Administration on the "Web Application Features" page. Speaking from experience, be sure you have the correct web application selected before you activate the feature.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Part 2 to be coming shortly.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Enjoy!&lt;br /&gt;--andrew&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Links to solution files:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="https://docs.google.com/View?docid=dcsmfgs2_3rkz8qqcc&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;manifest.xml&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://docs.google.com/View?docid=dcsmfgs2_4d42rb2g2&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;wsp_structure.ddf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://docs.google.com/View?docid=dcsmfgs2_2hpckcrcr&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;Feature.xml&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://docs.google.com/View?docid=dcsmfgs2_0htj4hrhj&amp;amp;pageview=1&amp;amp;hgd=1&amp;amp;hl=en"&gt;AjaxControlToolkitSupportInstaller.cs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-4373884791390858911?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/4373884791390858911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/10/moss-cascading-dropdownlists-sexy.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4373884791390858911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4373884791390858911'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/10/moss-cascading-dropdownlists-sexy.html' title='MOSS Cascading DropDownLists - The Sexy Approach - 1 of 2'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-6984409778365865000</id><published>2008-12-05T16:58:00.002-05:00</published><updated>2008-12-05T17:23:04.357-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 3.5 SP1'/><category scheme='http://www.blogger.com/atom/ns#' term='Access Denied'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>.Net Framework 3.5 SP1 and SharePoint Search/InfoPath/Etc.</title><content type='html'>Recently, I installed &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displaylang=en"&gt;.NET framework 3.5 SP1&lt;/a&gt; onto my production SharePoint WFE after thoroughly testing a new AJAX based field control I had developed. &amp;nbsp;In my staging and development environments, I encountered no issues with the framework itself, however, once I installed on production, a couple issues arose:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Administrator approved InfoPath forms with custom code were causing errors (no indication of what the error was)&lt;/li&gt;&lt;li&gt;Search Service was failing to crawl content with the error "Access Denied."&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;After some Googling, I came across a &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;896861"&gt;MS KB article&lt;/a&gt;&amp;nbsp;, and an &lt;a href="http://blogs.msdn.com/jiruss/archive/2007/01/19/access-denied-error-when-running-app-on-iis-6-and-iis-5-1-runs-fine-on-windows-2000.aspx"&gt;MSDN blog&lt;/a&gt; both referring to a security feature in IIS 6 called "loopback check." &amp;nbsp;This feature was added (also present in IIS 5.1) to prevent reflection attacks on the server. &amp;nbsp;Please see the blog entry by &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;jiruss&lt;/span&gt; for more information on this feature.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Of the two workarounds listed, either disabling the loopback check, or modifying the host names specified in the registry, I believe modifying the host names to be the best solution. &amp;nbsp;I agree with &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;jiruss&lt;/span&gt; in that completely disabling the loopback check increases the attack surface area of your system, and should be avoided.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The actual modifications I made were to add the URL/host headers/AAM mappings for my various sites (main portal and mysites were the only two that did not use the machine name in AAM) to a newly created "Multi-String Value" registry key called &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;BackConnectionHostNames&lt;/span&gt; (each entry on a separate line) at the registry path:&lt;/div&gt;&lt;div&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this helps any people experiencing "Access Denied" related issues after installing .NET framework 3.5 SP1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Enjoy!&lt;/div&gt;&lt;div&gt;--andrew&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-6984409778365865000?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/6984409778365865000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/12/net-framework-35-sp1-and-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/6984409778365865000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/6984409778365865000'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/12/net-framework-35-sp1-and-sharepoint.html' title='.Net Framework 3.5 SP1 and SharePoint Search/InfoPath/Etc.'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-4340308099241974184</id><published>2008-07-28T11:02:00.016-04:00</published><updated>2009-02-13T18:00:03.914-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Designer'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='List Input Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='DataView Web Part'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>Customized Input Forms:  The JavaScript Approach</title><content type='html'>&lt;i&gt;Correction [02.13.2009]: I have recently been informed of an issue with field values not saving when they are disabled for the user.  Please see my post &lt;a href="http://arichterwork.blogspot.com/2009/02/correction-customized-input-forms.html"&gt;here&lt;/a&gt; for updated code.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If any of you have had to customize the input forms for lists or libraries in SharePoint, you'll know that it is not easy.  You can customize the form with a custom list form web part, but you better not delete the original list form web part, otherwise your list gets hosed.  You can have both on the page (with the original web part hidden), but then you lose attachment support with JavaScript errors.  If you create a new page without the original list form web part, then you get a nice JavaScript alert saying that the form has been customized to not allow attachments.   If you used the custom list form web part, then you might find it cumbersome and tedious to make changes when new columns are added.  I have tried countless recommendations for modifying the list input form, and none of them really seemed to work cleanly and effectively.  Until I stumbled across the forum discussion located &lt;a href="http://forums.msdn.microsoft.com/en-US/sharepointcustomization/thread/d3ebb776-f80d-46aa-9cb9-38f90652d001/#page:1" target="_blank"&gt;here&lt;/a&gt; on MSDN Forums.&lt;br /&gt;&lt;br /&gt;Of all of the ideas proposed in this forum topic, I found &lt;span style="font-weight: bold;"&gt;tscheifler&lt;/span&gt;'s usage of JavaScript quite intriguing.  There were some limitations that I found when implementing their exact solution (most notably around disabling columns of type: Lookup, Date and Time, and Multiple lines of Text).  Extending this, and incorporating various other bits of information lying about the web, I ended up with a solution I am quite happy with.  This assumes you have an existing list with several fields you would like to hide/disable for certain user groups.  We will begin by modifying the "NewForm.aspx" page, but these steps will work for any of the input forms:&lt;ol&gt;&lt;li&gt;Open the "New Form" for the list and remove all query string variables (should end up with &lt;span style="font-style: italic;"&gt;http://server/site/listname/&lt;/span&gt;NewForm.aspx)&lt;/li&gt;&lt;li&gt;Append "?ToolPaneView=2" onto the end of the url (&lt;span style="font-style: italic;"&gt;http://server/site/listname/&lt;/span&gt;NewForm.aspx?ToolPaneView=2)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note: this places the page into "Add a Web Part" view&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Add a new "Content Editor Web Part"(CEWP) to the page after the existing web part&lt;/li&gt;&lt;li&gt;Modify the source view of the CEWP to include this code:&lt;br /&gt;&lt;pre&gt;&amp;lt;SCRIPT LANGUAGE="JavaScript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function disableChildren(currentElement)&lt;br /&gt;{&lt;br /&gt;if (currentElement)&lt;br /&gt;{&lt;br /&gt;if(currentElement.tagName == "IFRAME")&lt;br /&gt;{&lt;br /&gt;frm = window.frames[currentElement.id].document;&lt;br /&gt;disableChildren(frm.getElementsByTagName("html")[0]);&lt;br /&gt;}&lt;br /&gt;var i=0;&lt;br /&gt;var currentElementChild=currentElement.childNodes[i];&lt;br /&gt;while (currentElementChild)&lt;br /&gt;{&lt;br /&gt;disableChildren(currentElementChild);&lt;br /&gt;i++;&lt;br /&gt;currentElementChild=currentElement.childNodes[i];&lt;br /&gt;}&lt;br /&gt;if (currentElement.tagName)&lt;br /&gt;{&lt;br /&gt;currentElement.setAttribute("disabled", "true");&lt;br /&gt;currentElement.setAttribute("contentEditable",&lt;br /&gt;"false");&lt;br /&gt;currentElement.setAttribute("onclick", "");&lt;br /&gt;currentElement.removeAttribute("href");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function hideRowsAfter(currentRow)&lt;br /&gt;{&lt;br /&gt;row = currentRow.nextSibling&lt;br /&gt;while (row)&lt;br /&gt;{&lt;br /&gt;row.style.display = "none";&lt;br /&gt;row = row.nextSibling;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function findControl(FieldName, opp)&lt;br /&gt;{&lt;br /&gt;FieldName = "FieldName=\"" + FieldName + "\"";&lt;br /&gt;//get all comments&lt;br /&gt;var arr = document.getElementsByTagName("!");&lt;br /&gt;for (var i=0;i &amp;lt; arr.length; i++ ) &lt;br /&gt;{&lt;br /&gt;// now match the field name&lt;br /&gt;if (arr[i].innerHTML.indexOf(FieldName) &amp;gt;= 0)&lt;br /&gt;{&lt;br /&gt;switch(opp) &lt;br /&gt;{&lt;br /&gt;case 0:  //disable all children&lt;br /&gt;disableChildren(arr[i].parentNode.parentNode);&lt;br /&gt;break;&lt;br /&gt;case 1:  //hide row&lt;br /&gt;arr[i].parentNode.parentNode.style.display="none";&lt;br /&gt;break;&lt;br /&gt;case 2:  //hide all rows after current&lt;br /&gt;hideRowsAfter(arr[i].parentNode.parentNode);&lt;br /&gt;break;&lt;br /&gt;default:&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function disableControls(inputArray)&lt;br /&gt;{&lt;br /&gt;for (var i=0; i &amp;lt; inputArray.length; i++)&lt;br /&gt;{&lt;br /&gt;findControl(inputArray[i], 0);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function hideControls(inputArray)&lt;br /&gt;{&lt;br /&gt;for (var i=0; i &amp;lt; inputArray.length; i++)&lt;br /&gt;{&lt;br /&gt;findControl(inputArray[i], 1);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function hideControlsAfter(input)&lt;br /&gt;{&lt;br /&gt;findControl(input, 2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Usage:&lt;br /&gt;// disableControls(["Field Name 1", "Field Name 2"..]);&lt;br /&gt;// hideControls(["Field Name 1", "Field Name 2"..]);&lt;br /&gt;// hideControlsAfter("Field Name");&lt;br /&gt;&lt;br /&gt;//--&amp;gt;&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Follow the "Usage notes" to add calls to the disableControls, hideControls, or hideControlsAfter functions which will modify the fields displayed on the page&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note: you can find the values to put in place of "Field Name 1" and "Field Name 2" by viewing the source view for the page and searching for: FieldName="&lt;br /&gt;The value within the double quotation marks will be what you enter inside the arrays in the hide/disable function calls.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;In the CEWP's tool pane, add security groups or audiences which should have the fields hidden/disabled to the "Target Audience" setting&lt;/li&gt;&lt;li&gt;Save the web part properties, and click the "Exit Edit Mode" link in the upper right below "Site Actions".&lt;/li&gt;&lt;/ol&gt;Now you should see all of the fields hidden or disabled based on your security settings specified within the CEWP.&lt;br /&gt;&lt;br /&gt;To extend this into a more reusable solution, I created a custom CEWP with this JavaScript code, exported it to a .dwp file, and then uploaded it to the Web Part gallery.  Then, the only modifications needed are to add this web part to the page (under ToolPaneView=2 view), add the "usage" functions, and add the security groups to the targeted audiences.&lt;br /&gt;&lt;br /&gt;This solution now hides/disables fields specified within the &lt;span style="font-weight: bold;"&gt;original&lt;/span&gt; list input form, which retains the attachment functionality, while being able to easily make modifications when new fields are added/modified based on column ordering.&lt;br /&gt;&lt;br /&gt;However, there are some limitations to this method.  None of which were show stoppers for me, since this method is very easy to undo (simply remove the CEWP from the forms).  Especially in the interim until Microsoft is able to fix this little problem and offer a clean, efficient, and effective method of customizing input forms.  These limitations are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Security groups or audiences need to be created for the group of users which should have limited access to list fields, which &lt;span style="font-weight: bold;"&gt;excludes&lt;/span&gt; the users with access to the restricted fields.&lt;/li&gt;&lt;li&gt;You cannot make any of the hidden/disabled fields required unless you specify default values, as the fields will still remain on the page and submit data, they are just hidden to the user&lt;/li&gt;&lt;li&gt;If the user employs firebug or other plugins which can alter JavaScript, they could unhide/undisable the fields you removed and then manipulate the data&lt;/li&gt;&lt;li&gt;Information in these fields is still visible to users if the columns are displayed within list views, as well as Source View of the input form&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-4340308099241974184?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/4340308099241974184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/07/customized-input-forms-javascript.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4340308099241974184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4340308099241974184'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/07/customized-input-forms-javascript.html' title='Customized Input Forms:  The JavaScript Approach'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-2799793106546393602</id><published>2008-04-10T15:25:00.011-04:00</published><updated>2008-04-17T16:33:39.103-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Field Comparison'/><category scheme='http://www.blogger.com/atom/ns#' term='Conditional Formatting'/><category scheme='http://www.blogger.com/atom/ns#' term='Case Insensitive'/><title type='text'>Comparing InfoPath Fields - Case Insensitively</title><content type='html'>Currently have a form deployed which has 4 different views:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;User&lt;/li&gt;&lt;li&gt;Manager&lt;/li&gt;&lt;li&gt;Process Owner&lt;/li&gt;&lt;li&gt;DBA&lt;/li&gt;&lt;/ol&gt;Each of the first three users (User, Manager, Process Owner) have an authorization field with an automatically filled in date field.  Each user can only read/write for their authorization, and have read access to the authorizations below them (User cannot see anyone else's, Manager can see User's, Process Owner can see Manager's and User's, DBA can see all).&lt;br /&gt;&lt;br /&gt;A problem arose where the Process Owner was actually the user's manager as well, but my rules for determining which view is presented to the user only showed this person the Process Owner view.  I did not want to create a new view just for the case of Process Owner == Manager, so I did the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Set the Manager's authorization field to Read/Write on the Process Owner view&lt;/li&gt;&lt;li&gt;Added a conditional formatting element to the Manager's authorization field to set it to read only when the managerID field does not equal the InfoPath function "userName()"&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;This was great, except everything is case sensitive, and there is no standard "toUpper" or "toLower" functions to standardize multiple fields on one case...enter &lt;a href="http://office.microsoft.com/en-us/infopath/HA012330391033.aspx#59.1"&gt;translate&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The resulting expression used in my conditional formatting is (broken onto multiple lines for ease of reading):&lt;br /&gt;&lt;pre&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;translate(&lt;br /&gt;  substring-after(&lt;br /&gt;    /my:myFields/my:grpEmployeeInformation/my:managerID,&lt;br /&gt;    &lt;span style="color: rgb(204, 0, 0);"&gt;"\"&lt;/span&gt;),&lt;br /&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;"ABCDEFGHIJKLMNOPQRSTUVWXYZ"&lt;/span&gt;,&lt;br /&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;"abcdefghijklmnopqrstuvwxyz"&lt;/span&gt;) !=&lt;br /&gt;translate(&lt;br /&gt;  xdUser:get-UserName(),&lt;br /&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;"ABCDEFGHIJKLMNOPQRSTUVWXYZ"&lt;/span&gt;,&lt;br /&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;"abcdefghijklmnopqrstuvwxyz"&lt;/span&gt;)&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Rather long and cumbersome, but you can see both the left and right hand sides of the "!=" translate all capital letters to their lower case equivalents.  The substring-after() bit was just an artifact of the structure of my form, where the managerID field is in the format of "domain\username".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note: Since this form uses the "userName()" function, it will probably require full trust.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-2799793106546393602?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/2799793106546393602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/04/comparing-infopath-fields-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/2799793106546393602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/2799793106546393602'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/04/comparing-infopath-fields-case.html' title='Comparing InfoPath Fields - Case Insensitively'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-787163894382303605</id><published>2008-04-02T16:09:00.005-04:00</published><updated>2008-04-02T16:24:17.086-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint Designer'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='DataView Web Part'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>DataView Web Parts and Page Layouts</title><content type='html'>The DataView Web Part is a nice tool to customize the way information is presented on a page.  Unfortunately, this web part is not available through the browser's "Add Web Part" interface, and must be added through SharePoint Designer.  The problem I ran into was that pages attached to a page layout cannot be directly modified within SharePoint Designer.&lt;br /&gt;&lt;br /&gt;I decided to detach the page from its layout and add the DataView Web Part.  Everything seemed to work, except I started to receive errors stating "This Web Part Page has been modified since you opened it."  I figured this was related to detaching from the Page Layout (I may have hosed something up unknowingly).  I then reattached the page to its layout and everything ended up working fine.&lt;br /&gt;&lt;br /&gt;Therefore, if you need to add a DataView Web Part to a page attached to a layout, I suggest doing the following(all done within SharePoint Designer):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Detach the Page from the Page Layout&lt;/li&gt;&lt;li&gt;Go through the necessary steps to add a DataView Web Part to an existing zone on the page&lt;/li&gt;&lt;li&gt;Reattach the Page to it's Page Layout&lt;/li&gt;&lt;/ol&gt;This was fantastic since detaching/reattaching to layouts does not change any web parts or customizations made to those web parts.  Also, once the DataView Web Part is on a page, you can simply modify it's display through the browser using the XSL editor.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note: I have not attempted to reattach a page to a layout after new zones have been added and do not know exactly what will happen.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-787163894382303605?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/787163894382303605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/04/dataview-web-parts-and-page-layouts.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/787163894382303605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/787163894382303605'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/04/dataview-web-parts-and-page-layouts.html' title='DataView Web Parts and Page Layouts'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-4228036373805786512</id><published>2008-03-26T12:54:00.005-04:00</published><updated>2008-03-26T15:31:33.329-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Forms Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Property Promotion'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>InfoPath Property Promotion Woes</title><content type='html'>&lt;span style="font-style: italic;"&gt;Note:  I experienced this issue with Administrator Approved templates only.  I am unaware if this is a problem with either of the other publishing methods or if it will fix those problems.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have been having issues lately with property promotion in InfoPath 2007 forms.  When I create, publish, and deploy a form to a SharePoint site, promoted properties function correctly.  If I add new structural elements and property promotion settings to a form after it has been deployed to a SharePoint site and is in use in a form library, then the new properties do not appear in SharePoint at all.&lt;br /&gt;&lt;br /&gt;This has surfaced as a concern within my company as we have a few forms in use which require structural/property promotion changes.  After several days of searching for any information on the capabilities and limitations of property promotion, I stumbled upon the following forum entry: &lt;a href="http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1778509&amp;amp;SiteID=17"&gt;Property Promotion - Full Trust Form - TechNet Forums&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In this forum post, there is some discussion of whether this is a bug or by design and possible resolutions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Jasbury&lt;/span&gt; summed up the thread as:&lt;br /&gt;&lt;blockquote&gt;The workarounds presented in this thread suggest the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rebuild the library or site&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Replace InfoPath’s “Automatically determine security level” with “Domain Security”&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Deactivate/Reactivate the InfoPath Form Template from the Site Collections&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;The first suggestion was not an option for my situation.&lt;br /&gt;The second suggestion did not apply to me as I experienced problems with automatic, domain, and full trust permission levels.&lt;br /&gt;The third option, however, was right on the mark.  Once I deactivated/reactivated the template, the new properties were promoted successfully.&lt;br /&gt;&lt;br /&gt;Thanks to &lt;span style="font-weight: bold;"&gt;bobchauvin&lt;/span&gt; for originally suggesting this:&lt;br /&gt;&lt;blockquote&gt;I also notice when using the Publish to Sharepoint as a content type that a change to the promoted cols wont take effect until you disable and then re-enable the content type for the site collection.&lt;/blockquote&gt;&lt;br /&gt;With a little investigation, I discovered what was causing &lt;span style="font-weight: bold;"&gt;Jasbury&lt;/span&gt;'s problem here: &lt;blockquote&gt;I was able to deactivate/reactivate with some success (thanks for this work-around!!!).  The missing content type columns were added.  However, changes to InfoPath property promotion were not reflected...huge bummer!!  That leaves me with no other options that to start over…again!&lt;/blockquote&gt;&lt;br /&gt;This is due to the order in which the steps were completed rather than a bug within SharePoint/InfoPath.  Field values within an InfoPath form are copied into the corresponding SharePoint columns when the form is saved/submitted.  If people have been filling out forms prior to fixing the missing columns in the content type, these values will not be stored anywhere.  Once the content type is correct, simply open any forms and save them again for the values to be copied.&lt;br /&gt;&lt;br /&gt;I recommend the following order for updating a form which has property promotion/structural changes:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Deactivate the form from all site collections it is active on&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Upload the new version of the form&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Reactivate the form on all necessary site collections&lt;/li&gt;&lt;/ol&gt;When you go to your SharePoint site, the content type will now reflect the correct promoted properties, and these columns will be available for use withn your form library views.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-4228036373805786512?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/4228036373805786512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/03/infopath-property-promotion-woes.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4228036373805786512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4228036373805786512'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/03/infopath-property-promotion-woes.html' title='InfoPath Property Promotion Woes'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-8287531641503007717</id><published>2008-03-20T14:13:00.006-04:00</published><updated>2008-03-26T13:46:12.325-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automatic Logon'/><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Security Settings'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Automatic Authentication'/><title type='text'>Automatic Login with Current User Name and Password....Doesn't</title><content type='html'>&lt;p&gt;Recently, I had to change my network password at work. This caused a problem which I was struggling to solve: every time I attempted to access the corporate intranet (with the IE setting "Logon automatically with current username/password"), it would prompt me for my password. It worked correctly before my password change, so I figured my password was being cached somewhere.&lt;/p&gt;&lt;p&gt;I attempted to empty the browser cache, restart the machine, relocate the intranet URL to another security zone; all to no avail.&lt;br /&gt;Just today I found a blog post by &lt;a href="http://nickporter.spaces.live.com/default.aspx"&gt;Nick Porter&lt;/a&gt; entitled: &lt;a href="http://nickporter.spaces.live.com/blog/cns!74ADCDB36B2CA33C!151.entry"&gt;SharePoint prompt for password after changing network password.&lt;/a&gt; In his post, he states:&lt;/p&gt;&lt;blockquote&gt;Cause:&lt;br /&gt;What seemed to happen was it was storing the old information in the&lt;br /&gt;Password list under the Manage Passwords section under "User Accounts". (Start &gt; Settings &gt; Control Panel &gt; User Accounts)&lt;br /&gt;&lt;/blockquote&gt;&lt;p&gt;His resolution was:&lt;/p&gt;&lt;blockquote&gt;1. Click "Start" &gt; "Settings" &gt; "Control Panel"&lt;br /&gt;2. Double click "User Accounts"&lt;br /&gt;3. Click on the "Advanced" tab&lt;br /&gt;4. In the "Passwords and .NET Passports" area click "Manage Passwords"&lt;br /&gt;5. Remove everything there.&lt;/blockquote&gt;&lt;p&gt;Albeit, you do not need to remove *everything* from the managed passwords if other sites are working correctly for you (and you want them to), but I removed the intranet URL, opened a new browser and navigated to the site...and it automatically logged me in!&lt;/p&gt;&lt;p&gt;Thanks Nick Porter.&lt;/p&gt;&lt;p&gt;Enjoy!&lt;br /&gt;--andrew&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-8287531641503007717?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/8287531641503007717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/03/recently-i-had-to-change-my-network.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/8287531641503007717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/8287531641503007717'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/03/recently-i-had-to-change-my-network.html' title='Automatic Login with Current User Name and Password....Doesn&apos;t'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-4308722959541964824</id><published>2008-03-05T14:50:00.019-05:00</published><updated>2008-12-13T02:21:47.989-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSS 3.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Master Pages'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='MOSS 2007'/><title type='text'>Programmatically Inherit Master Page and CSS in MOSS 2007</title><content type='html'>So recently I have been working on two small MOSS features:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Change the master page and stylesheet settings for a site&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Staple the first feature to all site templates, so it is activated upon site creation&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;I was able to create both features and deploy them with little difficulty.  See the following resources for tips on solutions, features, and stapling:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Becky Bertram - &lt;a href="http://www.beckybertram.com/"&gt;blog&lt;/a&gt; - &lt;a href="http://www.beckybertram.com/oldblog/index.php?p=33&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1"&gt;Applying a SharePoint Custom Master page Globally&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Jim Yang - &lt;a href="http://www.sharepointblogs.com/jimyang/default.aspx"&gt;blog&lt;/a&gt; - &lt;a href="http://www.sharepointblogs.com/jimyang/archive/2006/07/09/moss-2007-and-wss-3-0-master-page.aspx"&gt;MOSS 2007 and WSS 3.0 Master Page&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Paul Papanek Stork - &lt;a href="http://mindsharpblogs.com/pauls/"&gt;blog&lt;/a&gt; - &lt;a href="http://mindsharpblogs.com/PaulS/archive/2007/06/18/1903.aspx"&gt;Feature to Install a Custom Master Page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;The problem that I ran into was this little radio button:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ucbNPQO4xFY/R876pLJrVlI/AAAAAAAAAAU/P7BfYm_YTxc/s1600-h/inherit_radio.JPG"&gt;&lt;img src="http://4.bp.blogspot.com/_ucbNPQO4xFY/R876pLJrVlI/AAAAAAAAAAU/P7BfYm_YTxc/s320/inherit_radio.JPG" alt="" id="BLOGGER_PHOTO_ID_5174348607170238034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Brief rundown of SharePoint Object Model:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SPSite is a Site Collection&lt;/li&gt;&lt;br /&gt;&lt;li&gt;SPWeb is a Site within a Site Collection&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Within the SharePoint Object Model, there are a couple of properties of the SPWeb object which we will be using:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;[web_object].MasterUrl&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[web_object].CustomMasterUrl&lt;/li&gt;&lt;br /&gt;&lt;li&gt;[web_object].AlternateCssUrl&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;These values are read/write, so you can set the values to your own strings and the values in the database will be changed accordingly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: all of the following is done within the FeatureActivated function of a custom class inheriting from the SPFeatureReceiver class.  Now let's dive into some code (these are all different methods I tried to no avail)&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Created some variables and hard coded the locations within the feature:&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;string&lt;/span&gt; MasterUrl = &lt;span style="color: rgb(204, 0, 0);"&gt;"/_layouts/custom.master"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;string&lt;/span&gt; CustomMasterUrl = &lt;span style="color: rgb(204, 0, 0);"&gt;"/_layouts/custom.master"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;string&lt;/span&gt; AlternateCssUrl = &lt;span style="color: rgb(204, 0, 0);"&gt;"/StyleLibrary/Custom/CSS/stylesheet.css"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt; web = (&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;)properties.Feature.Parent;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = MasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.CustomMasterUrl = CustomMasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.AlternateCssUrl = AlternateCssUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Set the values of the current site to the values from the root site:&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt; web = (&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;)properties.Feature.Parent;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = web.Site.RootWeb.MasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.CustomMasterUrl = web.Site.RootWeb.CustomMasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.AlternateCssUrl = web.Site.RootWeb.AlternateCssUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Set the values of the current site to the values from it's parent site:&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt; web = (&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;)properties.Feature.Parent;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = web.ParentWeb.MasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.CustomMasterUrl = web.ParentWeb.CustomMasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.AlternateCssUrl = web.ParentWeb.AlternateCssUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;None of these methods, upon going to the "Site Master Page Settings" page within a browser, showed the little radio button next to "Inherit site master page from parent of this site" as being checked.  They did correctly set the master page and stylesheet links, but if I went to a parent site and changed the master page, the master page did not get changed on the site *unless* the "inherit" radio button was selected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I decided to take this to the Content Database for the portal in which I was working.  Looking in the dbo.Webs table, I found that if the "Inherit" radio button is selected, there are still values in the DB for AlternateCssUrl, MasterUrl, and CustomMasterUrl.  Running the above code, would put the same values in these fields, but the "Inherit" radio button would not be selected.  I then performed the following steps:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Copy a row  (one site) from the database to a text file&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change each of the 3 settings (Site Master, System Master, and Alternate CSS) from "Inherit" to "Specify a ..."&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy the same row from the database to the second row of the text file&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change each of the 3 settings back to "Inherit"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy the same row from the database to the third row of the text file&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change each of the 3 settings back to "Specify a ..."&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy the same row from the database to the fourth row of the text file&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;I then moved the side-scroll-bar all the way to the right (to confirm something in each lines was different) and they did not end at the same character, so I went to the beginning and compared vertically until I found different characters.  There were a total of 3 instances of different characters (all 3 instances had the same characters) all within the same field, 'MetaInfo'.  These values were:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"Inherit": 547275&lt;/li&gt;&lt;br /&gt;&lt;li&gt;"Specify a ...": 46616C73&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Going back to the SharePoint Object Model, I discovered that there are two member properties to the SPWeb object which seem to correlate to site properties: Properties and AllProperties.  I then tossed together a quick console app to output all Key/Value pairings for these two collections, and this is what came out:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;.Properties (C# type &lt;span style="color: rgb(102, 204, 204);"&gt;SPPropertyBag&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;vti_extenderversion: 12.0.0.4518&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associatevisitorgroup: 4&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_defaultlanguage: en-us&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associategroups: 5;4;3;6;7;8;9;10;11;14;15;17;18;28&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associateownergroup: 3&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associatemembergroup: 5&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;.AllProperties (C# type &lt;span style="color: rgb(102, 204, 204);"&gt;Hashtable&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;vti_extenderversion: 12.0.0.4518&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;__InheritsCustomMasterUrl&lt;/span&gt;: False&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associatevisitorgroup: 4&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_categories: Business Competition Expense\ Report Goals/Objectives Ideas In\ Process Miscellaneous Planning Schedule Travel VIP Waiting&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associatemembergroup: 5&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_defaultlanguage: en-us&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associateownergroup: 3&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_associategroups: 5;4;3;6;7;8;9;10;11;14;15;17;18;28&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;__InheritsAlternateCssUrl&lt;/span&gt;: False&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vti_approvallevels: Approved Rejected Pending\ Review&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;__InheritsMasterUrl&lt;/span&gt;: False&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/ul&gt;Fancy that, there are three properties which interest me most at this point (indicated in red).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I simply set these values to "True" (note, that is a string of "True" and not a 1 or C# &lt;span style="color: rgb(51, 102, 255);"&gt;true&lt;/span&gt;), which resulted in this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ucbNPQO4xFY/R876pLJrVlI/AAAAAAAAAAU/P7BfYm_YTxc/s1600-h/inherit_radio.JPG"&gt;&lt;img src="http://4.bp.blogspot.com/_ucbNPQO4xFY/R876pLJrVlI/AAAAAAAAAAU/P7BfYm_YTxc/s320/inherit_radio.JPG" alt="" id="BLOGGER_PHOTO_ID_5174348607170238034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, it did not pull the correct values to begin with.  Therefore, it would appear that SharePoint uses these settings for when the parent's master pages/css are changed, and not relying on these settings for everytime the site is accessed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All in all, here is the final code I came up with for my Feature (inside FeatureActivated function):&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt; web = (&lt;span style="color: rgb(102, 204, 204);"&gt;SPWeb&lt;/span&gt;)properties.Feature.Parent;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 204, 204);"&gt;Hashtable&lt;/span&gt; hash = web.AllProperties;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = web.ParentWeb.MasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;hash[&lt;span style="color: rgb(204, 0, 0);"&gt;"__InheritsMasterUrl"&lt;/span&gt;] = &lt;span style="color: rgb(204, 0, 0);"&gt;"True"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try &lt;/span&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.CustomMasterUrl = web.ParentWeb.CustomMasterUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;hash[&lt;span style="color: rgb(204, 0, 0);"&gt;"__InheritsCustomMasterUrl"&lt;/span&gt;] = &lt;span style="color: rgb(204, 0, 0);"&gt;"True"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;try &lt;/span&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.AlternateCssUrl = web.ParentWeb.AlternateCssUrl;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;hash[&lt;span style="color: rgb(204, 0, 0);"&gt;"__InheritsAlternateCssUrl"&lt;/span&gt;] = &lt;span style="color: rgb(204, 0, 0);"&gt;"True"&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.Update();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;catch&lt;/span&gt; { }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I hope this helps you, as I know I was pulling my hair out for a long time over this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;--andrew&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Correction [06.11.2008]: I just realized that in my final code, I had the following line:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = web.ParentWeb.CustomMasterUrl;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;This works just fine, except I am pulling the wrong master page setting from the parent site for the current setting.  This should read:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;web.MasterUrl = web.ParentWeb.MasterUrl;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;I have corrected this above in the code.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-4308722959541964824?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/4308722959541964824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/03/programmatically-inherit-master-page.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4308722959541964824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/4308722959541964824'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/03/programmatically-inherit-master-page.html' title='Programmatically Inherit Master Page and CSS in MOSS 2007'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ucbNPQO4xFY/R876pLJrVlI/AAAAAAAAAAU/P7BfYm_YTxc/s72-c/inherit_radio.JPG' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-2260851083611573771</id><published>2008-02-26T19:02:00.006-05:00</published><updated>2008-03-20T14:25:57.495-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Server 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='Remote Desktop Connection'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows XP'/><title type='text'>Remotely Enable Remote Desktop</title><content type='html'>Needed to remotely enable remote desktop on a Win2k3 machine, but all of the methods I could find suggested registry editing which posed a few problems:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Not a big fan of editing the registry of servers&lt;/li&gt;&lt;li&gt;Remote Registry service was not enabled on this particular machine&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Luckily, I found the following at &lt;a href="http://msgoodies.blogspot.com/2005/02/enable-remote-desktop-connections_08.html"&gt;msgoodies.blogspot.com&lt;/a&gt;:&lt;/p&gt;&lt;p&gt;From Win2k3:&lt;/p&gt;&lt;code&gt;&lt;/code&gt;&lt;p&gt;wmic /node:"&lt;i style="color: rgb(50, 200, 50);"&gt;Computer Name (FQDN)&lt;/i&gt;" /USER:"&lt;i style="color: rgb(50, 200, 50);"&gt;username&lt;/i&gt;" RDTOGGLE WHERE ServerName="&lt;i style="color: rgb(50, 200, 50);"&gt;Computer Name (FQDN)&lt;/i&gt;" CALL SetAllowTSConnections 1&lt;/p&gt;&lt;p&gt;From WinXP:&lt;/p&gt;&lt;code&gt;&lt;/code&gt;&lt;p&gt;wmic /node:"&lt;i style="color: rgb(50, 200, 50);"&gt;Computer Name (FQDN)&lt;/i&gt;" /USER:"&lt;i style="color: rgb(50, 200, 50);"&gt;username&lt;/i&gt;" PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1&lt;/p&gt;&lt;p&gt;Enjoy!&lt;br /&gt;--andrew&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-2260851083611573771?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/2260851083611573771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2008/02/remotely-enable-remote-desktop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/2260851083611573771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/2260851083611573771'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2008/02/remotely-enable-remote-desktop.html' title='Remotely Enable Remote Desktop'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-1863601700614059559</id><published>2007-09-21T19:16:00.000-04:00</published><updated>2007-09-21T23:18:59.133-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='Contact Selector Control'/><category scheme='http://www.blogger.com/atom/ns#' term='Forms Server'/><title type='text'>Requiring the Contact Selector in InfoPath 2007</title><content type='html'>The contact selector control in InfoPath makes implementing a user/group lookup field quite easy.  However, there are a few downsides.  &lt;a href="http://msmvps.com/blogs/benwalters/default.aspx"&gt;Ben Walters&lt;/a&gt; has done a very nice job of listing the upsides and downsides to using this control in his post, &lt;a href="http://msmvps.com/blogs/benwalters/archive/2007/07/13/contact-selector-the-good-and-the-bad.aspx"&gt;Contact Selector the Good and the Bad&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The one aspect of InfoPath (2003) that prevented company wide deployment at my employer was the need to have the InfoPath client in order to fill out a form.  Now that Microsoft has implemented Forms Server and allowed the filling of forms via a web browser, many of my colleagues have been banging at my door for custom InfoPath solutions.&lt;br /&gt;&lt;br /&gt;The requirement that I have been presented with was to use the Contact Selector control, to make it required, and to only allow one value.  After reading the above post by Ben, which references some validation code posted in a comment on the &lt;a href="http://blogs.msdn.com/infopath/"&gt;InfoPath Team&lt;/a&gt; blog, it became apparent there was no easy solution for browser-based forms.&lt;br /&gt;&lt;br /&gt;Below I offer my solution:&lt;ul&gt;&lt;li&gt;Domain trust form&lt;/li&gt;&lt;li&gt;No digital certificate&lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; InternalStartup()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;EventManager.FormEvents.Loading +=&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(51, 153, 153);"&gt;LoadingEventHandler&lt;/span&gt;(FormEvents_Loading);&lt;br /&gt;&amp;nbsp;EventManager.XmlEvents[&lt;span style="color: rgb(204, 0, 0);"&gt;"/my:myFields/my:contactSelector"&lt;/span&gt;].Changed +=&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(51, 153, 153);"&gt;XmlChangedEventHandler&lt;/span&gt;(contactSelector_Changed);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; FormEvents_Loading(&lt;span style="color: rgb(51, 51, 255);"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(51, 153, 153);"&gt;LoadingEventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&lt;span style="color: rgb(51, 153, 153);"&gt;XPathNavigator&lt;/span&gt; mainDS = &lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.MainDataSource.CreateNavigator();&lt;br /&gt;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.New)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 153, 153);"&gt;XPathNavigator&lt;/span&gt; contSel =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mainDS.SelectSingleNode(&lt;span style="color: rgb(204, 0, 0);"&gt;"/my:myFields/my:contactSelector"&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NamespaceManager);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Errors.Add(contSel, &lt;span style="color: rgb(204, 0, 0);"&gt;"ContactSelectorError"&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(204, 0, 0);"&gt;"You must select a contact."&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;return&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; contactSelector_Changed(&lt;span style="color: rgb(51, 51, 255);"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(51, 153, 153);"&gt;XmlEventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (e.Site.SelectChildren(&lt;span style="color: rgb(51, 153, 153);"&gt;XPathNodeType&lt;/span&gt;.Element).Count == 1)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;try&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Errors.Delete(&lt;span style="color: rgb(204, 0, 0);"&gt;"ContactSelectorError"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;catch&lt;/span&gt; { }&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (e.Site.SelectChildren(&lt;span style="color: rgb(51, 153, 153);"&gt;XPathNodeType&lt;/span&gt;.Element).Count &amp;gt; 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Errors.Add(e.Site, &lt;span style="color: rgb(204, 0, 0);"&gt;"ContactSelectorError"&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(204, 0, 0);"&gt;"Only one contact can be selected."&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;if&lt;/span&gt; (e.Site.SelectChildren(&lt;span style="color: rgb(51, 153, 153);"&gt;XPathNodeType&lt;/span&gt;.Element).Count &amp;lt; 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(51, 51, 255);"&gt;this&lt;/span&gt;.Errors.Add(e.Site, &lt;span style="color: rgb(204, 0, 0);"&gt;"ContactSelectorError"&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(204, 0, 0);"&gt;"You must select a contact."&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Some notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"/my:myFields/my:contactSelector" is the XPath to the Contact Selector control.  This is the main group, i.e. in my example, it would be:&lt;br /&gt;&lt;pre&gt;&amp;lt;contactSelector&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Person&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DisplayName /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;AccountId /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;AccountType /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/Person&amp;gt;&lt;br /&gt;&amp;lt;/contactSelector&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;"ContactSelectorError" is the name of the error being added/deleted.  It is not displayed to the user, but rather the internal error name for code references.&lt;/li&gt;&lt;li&gt;I only add the error in the loading event for new forms, since an existing form would already have these fields required. An alternative to this.New would be to test the Contact Selector control for a value, and add the error if it's value was equal to the empty string ("").&lt;/li&gt;&lt;li&gt;In the function "contactSelector_Changed", you must have a try/catch around the delete statement, because if you attempt to delete an error that does not exist, an error will be thrown.&lt;/li&gt;&lt;li&gt;If you have multiple contact selector controls on your form, you will need a seperate "onChanged" event for each control, and I would suggest simply changing the name of the error from "ContactSelectorError" to something like "ContactSelectorErrorEmployee", and ensure each contact selector control has a unique name for its error.  You will also need as many "this.Errors.Add" lines in the loading event as you have contact selector controls you want validated.&lt;/li&gt;&lt;/ul&gt;Enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-1863601700614059559?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/1863601700614059559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2007/09/requiring-contact-selector-in-infopath.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/1863601700614059559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/1863601700614059559'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2007/09/requiring-contact-selector-in-infopath.html' title='Requiring the Contact Selector in InfoPath 2007'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-136372299889916108.post-7371341802106735372</id><published>2007-09-21T18:27:00.000-04:00</published><updated>2007-09-21T18:56:31.177-04:00</updated><title type='text'>Welcome!</title><content type='html'>Welcome to my professional blog.  I am a software developer spending much of my time currently within Microsoft SharePoint.  I have been doing SharePoint administration and development for a little over a year now, having started on SPS2003 (albeit, very little work in 2003) and now working within MOSS2007.  I have created this blog in an effort to record various problems/issues/bugs/"features" that I come across while working.&lt;br /&gt;&lt;br /&gt;I am not claiming that these are best practices or the only way to do things.  If you have a better way to solve any of my problems, I would be more than happy to hear them.&lt;br /&gt;&lt;br /&gt;Some things I anticipate to cover:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SharePoint (administration and development)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;InfoPath 2007&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Web Services&lt;/li&gt;&lt;/ul&gt;Several general disclaimers:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For all posts, whenever I refer to SharePoint, I am talking about MOSS2007.  If I ever need to talk about SPS2003, which I doubt, I will explicitly call it by that name.&lt;/li&gt;&lt;li&gt;Please do not attempt to correct my posts based solely on grammar/spelling.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When appropriate, I will attempt to provide useful screen shots of the errors I receive and the steps I took to fix them.&lt;/li&gt;&lt;li&gt;[Reserved for future disclaimers]&lt;/li&gt;&lt;/ul&gt;Thanks, and enjoy!&lt;br /&gt;--andrew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/136372299889916108-7371341802106735372?l=arichterwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arichterwork.blogspot.com/feeds/7371341802106735372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arichterwork.blogspot.com/2007/09/welcome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/7371341802106735372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/136372299889916108/posts/default/7371341802106735372'/><link rel='alternate' type='text/html' href='http://arichterwork.blogspot.com/2007/09/welcome.html' title='Welcome!'/><author><name>andrew</name><uri>http://www.blogger.com/profile/00163072873567979348</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
