.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

Document library uploadpage redirect to a view.

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

Hi I ahve a document library. In the upload page, If I click cancel button it showld redirect to one of the document library's view page.

public class ABCUploadPage : Microsoft.SharePoint.ApplicationPages.UploadPage
    {        protected override void OnLoad(EventArgs e)

                   // what to write :(



Please let me know, What is the exact code to write here?



View Complete Post

More Related Resource Links

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.


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 


When the user want click on document library that should be navigate default view



I have document library which is having folders,the document library i have displayed as tree view in the left side of the page.

Here Document library having views,suppose i have selected one view on the document library it is navigating the particular view that is good but when i am trying to click document library folder still the page in same view do not navigate the default view .

I need when ever i click on any of the folder in document library that should navigate defualt view ,could you please help me on this.

Really its need urgent...


overwrite the files in document library from Explorer View ?

Hi Everyone, Suppose I have a document library which can be opened using the explorer view, what happened if someone uploads to this library by drag n drop into the library with same filename? What would be the final story of the file which is overwritten through drag n drop from Explorer view ? Thanks./* Infrastructure Support Engineer */

New / Upload / Actions / Settings / View menus on a document library are hidden

I have a Document library. On the View Page (All Documents) for the Document library, I do not see the menu bar with the "New / Upload / Actions / Settings / View" menus. It looks like one of the users with owner permissions did something to cause this behavior. No custom code exists on the page. I am not sure how this menu bar can be hidden. Can someone please clarify. I am a site collection administrator.

How to remove Title, Created By etc from Document library view?

How to remove title of columns of the Document Library/Links/Annoucements so that only WebPart Title and items are displayed?Kenny_I

How can I change the height of the rows in a document library webpart view to minimize the space bet

In SP2010 documents listed in a document library view (attached as webpart) are quite far from each other (height of each row is too big). How can I change the height that spaces between the documents are limited to a minimum, hence more documents are visible on my screen. (e.g. if I have many documents in my document library and add a webpart to my page that should show all documents, I would see more documents if the height of the row would be smaller (e.g. 16px) and spaces minimized. Moreover how can I make a smaller height for each row the default height?

How to display the thumbnail view of the documents in Sharepoint Document Library

Is there a way that we can have the thumbnail view of the documents that are uploaded in SharePoint Document Library. We have thumbnail feature in Picture Library but can we have the same in Document Library too. Documents includes Words,Excel,PDF. Any Suggestions Please 

refresh document library view using javascript

Hi, Is it possible to refresh a document library view from javascript without executing a full pagre reload? Could anyone cite an example.\   Thanks in advance M

Showing the SPBuiltInFieldId.ItemChildCount Field in a Document Library View?


Is it possible to display the number of items contained within a sub-folder within a document library?  When the user opens up the document library, he would like to see next to any sub-folder the number of items contained in that subfolder without having to navigate into it.

In the MSDN documentation there is a built-in field, SPBuiltInFieldId.ItemChildCount,where the number of items is kept.  Can this field be used to accomplish this requirement?  If so, is there any information on using the SharePoint object model on how to expose it?  It is not accessible from the Document Library Settings.



View previous version of a file in document library using Client Object Model




Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :




When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?

Document Library View - "Folders or Flat --> Show all items without folders" setting not being saved


A view of a document library has a setting under Folders area if the files should be shown in their respective folder or just a flat list of file. If "Show all items withtout folders" is selected, following is my observation:

- Saving the document library as a template and creating new libraries from this template takes this setting into the new library as expected
- Saving the site as a template and creating a new site from template removes this setting from the existing document libraries in newly created sites. If a new document library is created from the document library template, the setting is ON as expected.

This seems to be related to what being discussed here http://stackoverflow.com/questions/3574095/hiding-folder-structure-for-a-view-in-sharepoint-2010-list-definition and http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/05e46fc9-cb26-4d00-aaf0-e4b6ee944104

Any feedback?

Document Library and Data View - New Item


I want to add a Data View WebPart to upload a new document to a SharePoint Document Library.

What I'm aiming to do is to have a list item displayed on a page and then upload related files to a document library rather as list item "attachments".  So the user would come on to the page, see the list item and have an upload box underneath with all the document's metadata next to the upload  Can this be done using SPD?

I've had a quick look around and I'm suspecting the answer to this is "NO" but I thought I'd ask anyway.

(I'm thinking custom webpart)

Conditionally Change Folder Icon in document library view (SP 2007)


Hi All,

How can I change the folder icon in the default document library view?  The catch is, I don't need to do this across the board, instead, I need a custom folder icon based upon the individual folder's properties.

I'm aware of the file ..\Web Server Extensions\12\TEMPLATE\XML\DOCICON.XML, but that's not what I need.

My initial thought, was to find the page that sharepoint uses as the template, find the <img> src attribute, and chnage it from


to something like


my GetIcon.aspx page would then look up the folder's properties, and return the expected .gif file.  However, I don't know which file is used.


Hyperlink not showing correctly in display view of document library


I have a publishing hyperlink column in a document library called "Related Documents". When I click on the link the select a hyperlink, I can link it to another document in my library.  On the edit view it display correct, i.e. it shows the name of the document with it corresponding icon.

When I view the properties of the document, it does not show the "Related Documents" correctly.  It displays the actual code, i.e. <a href="/path of file"><img alt="" src="/_layouts/IMAGES/icxlsx.png">file name</a>

How can I get it display the same a in the Edit view?

unable to see explorer view in sharepoint document library


Hi Guys,

Am unable change document libray to explorer view and it is taking ages to open in explore view can anyone help me on this.And this is sharepoint 2007


Sarath Sannadi Sharepoint Dev at Saksoft

Renaming a document in Document Library in datasheet view gives Unexpected Error



I have a document library. Whenever I try to rename any of the document or change any property of a particular document, whenever I have opened the document libary in Datasheet mode, I get pending changes and then an error. When I click on Resolve, I get the error message "An unexpected error has occured". Now this error comes only for the document library that have versioning enabled. Also if the document hasnt been checked out, it gives proper error message that "You need to check out the file before modifying it". What could be the issue?

Thanks, Tejas
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