.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Updating "modified" within nested folders

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#


Let me start with what I'm trying to accomplish to see if there's an easier way to go about it and then I'll get to my question.

We are redesigning the homepage of our department and one particular webpart has been causing me problems. We have a nested file structure in a document library with the top level folder indicating specific projects. I want to be able to filter the projects to show the last modified, but I also want the date modified field to change for the top level folder if any sub folder has document changes. As of right now, any update within the nested structure does not update the top-level folder which defeats the purpose of using the last modified filter.

Question: Is there a setting that can be changed or a particular ordering of the libraries that will accomplish this for me? If not, am I confined to writing code to accomplish this effectively?

Thanks for your help.


View Complete Post

More Related Resource Links

Updating "Modified By" Column Via SharePoint Web Services


Here is my situation:  I have a web app running on a non-SharePoint machine that uses the SharePoint web services (specifically, the Copy web service) on another box to shoot documents to the Shared Documents library.  That works all fine and dandy.  Then a requirement came in that fields need to be updated when the document is uploaded.  Again, not much problem there.  However, then a requirement came in where they wanted the user's name displayed in the "Modified By" column.  When documents are currently uploaded, the "Modified By" column displays the name of the resource account that the web app runs under on the remote machine.  This isn't really helpful to users.  They want to know the name of the user who uploaded the document, not the resource account they were impersonating in order to upload the document.  Is it possible to accomplish this using the FieldInformation class that accompanies the Copy web service provided by SharePoint?  I tried something like the following but it did not work:

fieldInfo = new SPCopyWS.FieldInformation();
fieldInfo.Type = SPCopyWS.FieldType.Text;
fieldInfo.DisplayName = "Modified By";
fieldInfo.Value = "Ruslander, Andrew";

Nested updatepanel updating all the update panel



I have one update panel which is having tPlaceholder which is loading dynalically.

<asp:UpdatePanel ID="UpdatePanel_ForumContent" runat="server" UpdateMode="Conditional">
            <asp:PlaceHolder ID="ForumTopicPlaceHolder" runat="server" Visible="true"></asp:PlaceHolder>

in the CS file on page load, adding Placeholder dynalically

 Control ForumTopicTabControl = LoadControl("Topic.ascx");
                Assembly objAssembly = BuildManager.GetCompiledAssembly("~/Topic.ascx");
                Type objType = objAssembly.GetType("Blogs_ForumTopic");
                PropertyInfo objProperty = objType.GetProperty("TableName");
                objProperty.SetValue(ForumTopicTabControl, dr["TopicTableName"].ToString(), null);
                objProperty = objType.GetProperty("HeaderName");
                objProperty.SetValue(ForumTopicTabControl, dr["Name"].ToString(), null);
                objProperty = objType.GetProperty("HeaderDesc");
                objProperty.SetValue(ForumTopicTabControl, dr["Description

Determine permissions for a document library with nested folders


I have a document library with many nested folders.  Each folder has unique permissions.  Is there a way to get a report of all permissions assigned to this document libary/folders? 

Modified by updating when document opened read only


I have several users that when they open documents the modified date and username change even if they do not save the document. In fact those fields change even if the user selects to open the document read only.

I have verified that it only happens on their machines, if they login to another system (different config) it works as expected.

All affected users are on:
Windows 7 64bit
Office 2007 SP2

SharePoint 2007 updated to February 2011 CU
All servers in the farm are 2008 except for the DB which is SQL 2005 on Server 2003

Any help would be greatly appreciated

SharePoint document migration challenges when migrating files and folders

There are several challenges when migrating documents to Microsoft SharePoint. While these challenges can be overcome, they are a real pain if the migration source, content and file systems are not SharePoint friendly.

Binding Nested Listviews in MVC ViewPage


I am a longtime .NET developer but for big applications and services.  This is my first asp.net project and I have chosen MVC.   I have a need for nesting a ListView within a ListView.  In this simple catalog app, I have EF 4 Entities that are Categories, SubCategories, ItemTypes, and Items.

My goal is to display a 5 column layout of SubCategories with their ItemTypes below them in a ViewPage.  I did just fine with it done out in C# as server directives such as:

    var subcats = Model.SubCategory.ToArray();
    var nrSubCats = subcats.Count();
    var rows = (nrSubCats/5) + (((nrSubCats % 5) > 0) ? 1 : 0);
    for (var row = 0; row < rows; row++)
    { %>
        <div style="width: 100%; float: left; clear: right;">
        var start = row * 5;
        for (var i = start; (i < start + 5) && (i < nrSubCats); i++)
        var subcat = subcats[i];
            <div style="float: left; clear: right; width: 20%; margin-left: 5;">
                <h2> <%:subcat.Name%></h2>
                    foreach (var its in subcat.ItemType)

MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

Error when updating. Supposedly updating ID without being asked.



Server Error in '/' Application.

Value of member 'ID' of an object of type 'Ref' changed.
A member defining the identity of the object cannot be changed.
Consider adding a new object with new identity and deleting the existing one instead.

I get this error whenever I attempt to update an entry. Even an entry that has had nothing altered. I have tried to circumvent it but I think it must be a simple oversight. How could I have caused an ID update using the Edit.aspx page of dynamic data? Thank you in advance for the help!

Nested Tracers - is there a way to only log the outer trace?



I have some nested tracers. The outer one has a category of 'PageTrace' and the inner ones have categories of 'DBTrace'. When I set the outer category source to 'All' I get both traces. When I switch on the inner trace, I just get the inner trace.

So, my question: is there any way to just log the outer trace events, i.e. the Page Traces.




LDAP nested groups filter


Hi all,

In my organization we use nested groups.

For a particular usage, we have a group (let's assume that the group name "kuku"), and the names of all the nested groups under it contains "kuku" as well.

We may assume that no other group in the LDAP has "kuku" in the name.

I need to create a filter which will return all the users which belong to one of the "kuku"s group.

Obviously, using this filter will bring only the head kukus

(&(&(objectclass=user)(objectclass=person))(memberOf=CN=kuku,cn=.rest of the group DN.))

How can I use wild card to fetch all users which belong to any kuku?

For example: (&(&(objectclass=user)(objectclass=person))(memberOf=CN=.*kuku.*))



The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)


Hey guys

I came across this bug using while trying to implement a sitemap

Line 147:						Panel panel = new Panel();
Line 148:						panel.Controls.Add(_viewState);
Line 149:						Page.Form.Controls.Add(panel);
Line 150:						string script = "document.getElementById('" + _viewState.ClientID + "').value = GetViewState__AspNetTreeView('" + Extender.MakeChildId("UL") + "');";
Line 151:						Page.ClientScript.RegisterOnSubmitStatement(typeof(TreeViewAdapter), _viewState.ClientID, script);

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +8696951
   CSSFriendly.TreeViewAdapter.SaveAdapterViewState() in E:\wwwroot\ThirdParty\CSSFriendly\CSSFriendly_24242\CSSFriendly\TreeViewAdapter.cs:149
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +8901848
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Data Points: Updating Data in Linked Servers, Information Schema Views, and More


Every day a developer somewhere needs to write code to iterate through SQL ServerT system objects, query and update tables in linked servers, handle optimistic concurrency, and retrieve column and stored procedure metadata.

John Papa

MSDN Magazine November 2004

Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows


The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend