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

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

Add new item link wont add document to sub folder

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :C#

Hey everyone,

I have a list view web part that I am adding programatically so that everytime a certain site is created, a list is created, and that list is rolled up via the webpart. It has worked for some time now, and still works for sites that have been created, but for new sites I am getting a weird issue. When I have a folder in the list, and click the Add New Document link while inside that folder, it will place the document in root of the list, and not in the folder.

SPList list = SPWebExtensions.TryCatchGetListByTitle(web.Web, "Group Resources");

     lvw.ListName = list.ID.ToString("B").ToUpperInvariant();

     lvw.ID = "GenericListName";

     lvw.TitleUrl = list.DefaultViewUrl;

     lvw.WebId = list.ParentWeb.ID;

     lvw.ViewGuid = defaultViewGuid.ToString("B").ToUpperInvariant();

     manager.AddWebPart(lvw, "bottomZone", 0);

     ListViewWebPart savedLvw = (ListViewWebPart)manager.WebParts["GenericWebPartName"];

     // Get the view used in the web part by using reflection


View Complete Post

More Related Resource Links

Can i Map to external link from document library folder



Is There any one know how to link document library folder is to external site 



Change Item order wont work for folder items

Hello. Links lists in Sharepoint 2010 have Change Item Order Action which can order your items. I added new content type based on folder content type to my list. And When I want to order my folder items with Change Item Order action Sharepoint sorts my items randomly. For example with 4 folder items it sorts it right in 3 or 4 times. I can't see any rule in it's behavior sometimes it works sometimes not. For Link list items everything is OK. Anyone have an idea? Thanks.

How to Link to a Document content type but linking to a Folder

I have implemented the known "Link to a Document" content type to a Document Library (referenced below).  This works fine to documents, but we need to also enter UNC paths to Folders like file://\\servername\sharename\foldername

We can NOT create shortcuts to these folders, which is a work around someone else published.

If you add the Hyperlink field it allows you to enter a UNC path to externally stored folder just fine. So there must be some way to make this Link to a Document content type also open UNC Folders accurately.


Code Snippet
function HasValidUrlPrefix_Override(url)
            var urlLower=url.toLowerCase();
            if (-1==urlLower.search("^http://") &&
            -1==urlLower.search("^https://") && -1==urlLower.search("^file://"))
            return false;

Hyperlinking to individuals folder in a document library from one link

I have created a document library with a folder belonging to each person in our staff. I created a link in the top menu labeled "My Files". Is it possible from the "My Files" hyperlink to link directly to the folder of the individual logged in? Currently right now the link just opens the directory and the user will see just one folder which is ok but it would be neat to have it direct right to the root of their folder.

Creating a custom column with a link to document (other than the name field) in document library



I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!


When try to open a folder in a moss 2007 document library in Explorer View, the folder does not open


When try to open a folder in a moss 2007 document library in Explorer View, the folder does not open.

I am using IE7 and the path of the folder does not contains more than 100 characters.

Also it opening on few on the machines which has IE7.


link from one list item to another item in the same list?


I have a list in which it is possible for one item to be related to another list item in the same list.  I am trying make a column in the list which would contain a hyperlink to the related list item.  The primary column is called Bill Number, and the secondary column is Companion Bill Number .  The Companion Bill Number is the one I want to be a hyperlink to the list time in which that number is the primary Bill Number.  (hope that made sense!). 

I thought I could create a hypertext link out of the Companion Bill Number dynamically in a workflow action that runs on item creation.  I tried this by using the string builder to create a string for the hypertext link that I set to a workflow variable.  It looks like this  <a href="listURL.aspx?ID=[%Bill:CompanionBill%]">[%Bill:CompanionBill%].  Then in another action in the same workflow I tried to set the CompanionBill column to the variable value. 

What I ended up with was, instead of the number as a hyperlink, the text in the column reads as [%Bill:CompanionBill%].  I'm thinking this is failing because of the workflow process doesn't have the value of CompanionBill at the time I am asking it to set the variable value.

Any ideas on how I might make this dynamic link creation work?

How do I get the Name link to go to document properties instead of the doc itself?

Hello.  I need to link my documents/photos/etc to their properties page (DispForm.aspx), not directly to the item itself.  How do I change my code to do this?  I have SharePoint Designer, but I'm no big expert.  I have looked through all the different column names and types and cannot find one that does this.  Thanks.  Oh, I'm on WSS 3.0.

When i click on any other folder in the document library that will navigate to default view of DL?



I have document library with having some folder in the same ,i have displayed my library in the page as Treeview, so when i click on any of the folder in the library i need to navigate allitems.aspx page i.e default view page of the document library ,the document library having views.Suppose when i am in other view i have selected folder from library treeview folder is changing but view not navigate to default view.

pls help 


Sharepoint Workflow To Shoot Email Only When Folder Is Created In Document Library

Hi, Can anyone help me with the below issue, I am facing this from so long and didn’t figure out solution yet for the same. :( I want to send an email through SharePoint designer workflow only when a folder is created in document library (not file uploaded/updated event). Please provide me solution about how I can achieve this through SharePoint designer as don’t have enough coding acquaintance.

Search crawler 'breaks' Document ID link

Hi all - we have a Sharepoint 2010 development server up and running (very much Out of the Box configuration). The Document ID functionality has been enabled and appears to be working OK - each document has its own unique ID as predicted. In a team site (Corporate Comms), we have a document library where our corporate logo has been loaded (a small .bmp file). This image file has a unique Document ID. On the top level site, I have created a link to the corporate logo so that it appears on the 'entry' web page. The link to the image is : http://<servername>/_layouts/DocIdRedir.aspx?ID=CH07-7-1  where CH07-7-1 is the Document ID When first created, everything works OK and the image appears on the front page. However, once a search crawl has been run (either full or incremental), the image disappears and is replaced by a red cross (i.e. the URL link has been broken). I have tried this with a word document link (as opposed to a .bmp image) and this still works OK. I have also tried storing the image in a picture library (as opposed to a document library) and the same thing happens. Is there something funny happening specific to the .bmp image/Document ID/crawler ? Anything I need to configure ? Any help would be appreciated. Thanks, Richard.    

Creating a new document in Document Library from custom menu item (in the ECB)

Hello! I created a custom menu item in the ECB for a document library. I'd like for this to create a new document from this menu item. Additionally, I'd like to create a workflow where the Title of the document from which the menu action originates is inserted into a custom textfield in the new document that is created. Is this possible using SharePoint Designer?

Item/Document permissions affect Library/List permissions

When I change the permissions on a item/document in a library/list the permissions are also changed on the library/list even though I stopped inheritance.  When I change the permissions on the library/list it also changes permissions on items/documents in that list even if inheritance is removed.

Need to link multiple External Content List items to a single document metadata column

I have an external content list - for my purposes, the data isn't any fancier than a list of terms provided by a web service (read only - I don't need update/delete functionality). I want to be able to link any subset of those terms to a single document metadata column (in other words, I need it to work like a normal content list that is defined to allow multiple values in a column) but SharePoint doesn't let me do that on an ECL. I need the content list to be externally driven since more values are going to be added to an outside system over time, but I think it's possible that I may not need a full-fledged ECL list to make this work this way in SharePoint. Just to clarify: I don't need the metadata values in my documents to maintain a PERSISTENT link to the web service (if someone changes an underlying value in the web service DB, it doesn't need to be updated in the document table too). I just want SharePoint to offer up an updated set of source values from the web service if somebody goes in and edits the document metadata. Any ideas for how I can make this work?

Customizing Send To Other Location Functionality for a document library item in Moss 2007

Hi All i have a requirment to customize the Send To Other Location funtionality. while using OOTB Send to Other Location option for a document library item we have  selection like Prompt the author to send out updates when the document is checked in? <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateYes" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateYes">Yes</label> <input id="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo" checked="checked" name="ctl00$PlaceHolderMain$ctl01$ctl01$ShouldUpdate" type="radio" value="RadShouldUpdateNo" /><label for="ctl00_PlaceHolderMain_ctl01_ctl01_RadShouldUpdateNo">No</label> how we can set this option in my custom coding based on the user selection. i am not able to understand the functionality of the above option. can any one please explain the above option and let me know how to set this option programmtically in my custom code.   Thanks in Advance  muthu

How to display the number of versions that an item/document currently has?

Hello, If I enable versioning on a list, is there a way to display the number of versions in the version history for each item? Now I have to open the version history for each item to see how many versions there are. I need a quick overview in e.g. the view to see which items contain a lot of versions. Is that possible ?

[Client OM] Link to a Document

How do i create a "Link to a Document" ListItem in C#, using Client Object Model?   Thanks, SPN00b
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