How to hide "Respond to this Survey" when a user has already responded to the Survey

1. The Rendering Template for the Survey List is in the defaulttemplates.ascx control under 12/Template/Control template. 2. The rendering template ID is “ViewToolBar”. This template renders the "Respond to this Survey", Actions menu and Settings menu in the toolbar. 3. This template is a generic template which is used by Other lists as well. 4….


How to hide “Site Collection Administrators” link from settings toolbar menu of Out-of-the-Box User.aspx page (_layouts/user.aspx).

Option1 : Using a custom HttpModule to redirect to a custom-mngsiteadmin page. This approach ensures : The OOB page isn’t accessible, even if users put the actual url (layouts/mngsiteadmin.aspx") in the browser and try accessing it. Is easy to implement and supported. The following sample approach can be tested : <Sample-Code> public class MasterPageModuleHandler :…


Some of the WSS 3.0/MOSS API’s which fires the query SELECT TOP 2147483648

§    list.Items.XmlDataSchema   §    list.Items.Xml  §    list.Items.QueryFieldNames §    list.Items.NumberOfFields  §    list.Items.ListItemCollectionPosition  §    list.Items.Count §    list.Items.GetDataTable() §    list.Items.GetItemById(40) §    list.Items.ReorderItems() §    list.Items.Delete(40) §    list.Items.DeleteById(40) SPQuery without RowLimit property set would fire the same the query.   I have not listed all the API calls which would fire the above query.


How to use OrderBy using GetListItems method of SiteData.asmx (SPS 2003)

Sample code ————– SiteData.SiteData srvSiteData = new SiteData.SiteData(); srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials; string items = srvSiteData.GetListItems("{48414507-4436-4D47-BE59-9834D33F2B52}","<Query><OrderBy><FieldRef Name=\"Modified\" Ascending=\"True\"></FieldRef></OrderBy></Query>", "<FieldRef Name=\"Title\"/><FieldRef Name=\"Modified\"/>", 100);   If the Query looks like <Query><OrderBy><FieldRef Name=\"Modified\" Ascending=\"True\"></FieldRef></OrderBy></Query> the orderby would not work.   Change the XML Query to <OrderBy><FieldRef Name=\"Modified\" Ascending=\"True\"></FieldRef></OrderBy>


Custom Field Controls in Data Form webpart does not save data in Database

Any input control for that matter, a simple custom field control with a single text box into the DataFormWebPart. The field gets displayed well in the NewForm and EditForm. But on saving the form data is not saved.No errors thrown. Build and deploy the project attached to this post. Create a custom list and create…


How to customize the Item Form pages for the SharePoint Lists such as NewForm.aspx, DispForm.aspx and EditForm.aspx

Item form pages are the pages created based on the "Forms.aspx" as the setup page which is available under 12/Templates/Pages folder. 1. All the templates for the NewForm, EditForm and DispForm (Item Form pages) are defined in the defaulttemplates.ascx 2. This templates are associated with the List through content type 3. The FormTemplates of the…


Page Editing Toolbar – Problem with submit for approval node in the quick access

Came across an interesting issue with the quick access area in the page editing toolbar last week. The problem is with the “Submit For Approval” console node in the quick access. The “Submit for Approval” works fine as long as the OOB approval workflow is attached with the “Pages” library. But when the custom workflow…


How to Retain/Preserve "Modified By" while checking in a file

SPSite mySite = new SPSite(“<SiteURL>”); SPWeb myWeb = mySite.OpenWeb(); SPFolder myList = myWeb.Folders[“<DocLibName>”]; SPFile myFile = myList.Files[0]; SPUser myUser = myWeb.Users[“<User_Name>”]; CheckInFileByUser(myFile, “Checkin Comments”, SPCheckinType.MajorCheckIn, myUser); public static void CheckInFileByUser(SPFile file, string checkinComment,SPCheckinType checkinType,SPUser modifiedByUser) { MethodInfo mi = typeof(SPFile).GetMethod(“CheckIn”,BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof(string), typeof(SPCheckinType), typeof(bool), typeof(SPUser) }, null); try { mi.Invoke(…


Working with MWSDefault.master page along with meeting workspace definition

  Recently I came across an issue with a custom master page created based on the OOB MWSDefault.master page. MWSDefault.Master is the master page used by the OOB meeting workspace definition "MPS". This master page has been used with all the configuration of the MPS meeting workspace site definition. You can find this master page…


State machine workflow with delay activity

State based workflow that has a DelayActivity. The DelayActivity never fires and errors out eventually. The problem lies in the fact that the workflow calls  out to another DLL in the code activity following the DelayActivity. When the call is made a  “System.IO.FileNotFoundException: Could not load file or assembly” exception is raised. System.IO.FileNotFoundException: Could not…