.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

SlideLibrary programmatically create folder

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :SharePoint


I have created a workflow in visual studio 2010 for a slide library when i upload new slides that they get in a folder, if the folder doesn't excist the workflow will automatically create the folder and move the uploaded slide to the folder. I have a custom field "Folder name" that i use to enter a folder name where i can store the slides that i have uploaded.

The code that i use:

 SPListItem item = null;
 SPWeb web = null;
 string folderName = string.Empty;

 web = workflowProperties.Web;
 item = workflowProperties.Item;
 var name = item.Name.ToString();

      folderName = (string)item["Folder name"];
      if (folderName != string.Empty && folderName != null)

        SPFolder root = workflowProperties.List.RootFolder;

        string slideFolderUrl = SPUrlUtility.CombineUrl(root.ServerRelativeUrl, folderName);
        SPFolder slideFolder = web.GetFolder(slideFolderUrl);


View Complete Post

More Related Resource Links

Programmatically create an InfoPath form


I'm programmatically creating an InfoPath form using this article: http://www.bizsupportonline.net/infopath2007/programmatically-create-infopath-form-console-app.htm.


Everything works well up to 29 fields (my:field1 ... my:field29). After that it runs without an error and posts a form to the library however the icon does not switch to an infopath icon and the filename stays blanks. I don't believe this field specific, it seems to be happening when I use any 29 to 30 fields so I'm thinking its a memory issue with the stream reader.

Has anybody every had this issue before, is there a way to fix this?


Create user is creating aspxxxx.mdf database in my app_data folder


I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
			<deny users="?"/>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Programmatically delete a .webpart file from wpcatalogs folder from an IIS website


We are using a third party wsp in our solution which directly adds the web parts into the web application store rather than the web part gallery(References to them are present in IIS site's wpcatalog directory). We want to remove these web part files so that the users will not be able to add these web parts to pages directly. Or any other modification so that users will not be able to add these directly. Is there a way we can do this programmatically?

VS2008 and C#: How to create PictureBox controls programmatically in a FlowLayoutPanel ?

I am trying to create multiple PictureBox controls in a FlowLayoutPanel programmatically. The number of the PictureBox controls is dynamic depending on the target image folder. My current approach results a compilation error:             // (Works !)             pictureBox1 = new System.Windows.Forms.PictureBox();             pictureBox1.Width = 150;             pictureBox1.Height = 150;             flowLayoutPanel.Controls.Add(pictureBox1);             string sFileFullName = "Resources\\file1.bmp";             pictureBox1.Image = Image.FromFile(@sFileFullName);             // (Error !)             string pbName = "pictureBox";             for (int i = 0; i < 100; i++)             {             

how to create site collection by using custom template through programmatically?

hi all, how we can create site collection by using custom template through programmatically? please give me some suggestions. where we need to save this custom template... thanks in advance..

is there any problem if i create a site collection through programmatically which web application ha

hi all, My web application have 2  types of authentication -- for internal users (windows authentication) and external users (Form based authentication). I am creating site collections through programmatically in the web application. so this site collection should have the permission as form based authentication for external users and windows authentication for internal users. is it possible are not? please give me some suggestions on creating site collections which have form based authentication and windows authentication. thanks in advance......

how to create site collection by using custom template through programmatically?

hi all, how we can create site collection by using custom template through programmatically? please give me some suggestions. where we need to save this custom template... thanks in advance..

Possible to create sub folder under DynamicData/CustomPages/{table}/subfolder

Hi, Is there possibility to create a subfolder under   DynamicData/CustomPages/{table}/subfolder and way to redirect the pages to subfolder pages.

Create report that lists every user with permissions for each folder

I would like to have a report that will list each user with it's roles for every folder. We have a very large RS database with a lot of folders, we need some better way to keep track of permissions. I created a report that utilizes "GetPolicies" from http://localhost/reportserver/ReportService2005.asmx but I have to feed a folder name to get list of users. I can also (by using subreport) list all folders with users. However, I am not able to produce a report where I have it broken by user. any idea?

How to create a workflow programmatically?

Are there any samples that would show how to create and/or modify a workflow programmatically, i.e. from a program, not from VS.NET IDE or a hosted designer? For example, the program would create a new workflow, add a couple of activities to it, and save the serialized workflow definition (in a file or database). I can find examples explaining how to modify a workflow instance at run time, but I need to create a workflow definition, not the instance. Any hints? Thanks.Alek

Create list column, if column does not exist programmatically

Hi, I want to create a column in  the list programmatically. I tried this, and it created the column. But I would like to check if the list column already exist and if column does not exist, would like to create the column. How to check if a list column exists and if it does not exist, create the list column. I have used this code: [CODE] SPList MyList; MyList = currentweb.Lists[Constants.listname]; MyList.Fields.Add("FilesCount", SPFieldType.Number, false); MyList.DefaultView.ViewFields.Add("FilesCount"); MyList.DefaultView.Update(); [/CODE] Thank you

create workflow on a folder

within my document library i have placed some folders. the foldernames are the names of my technical users. when i place a document in one of those folders i want to send a email to the specific user. i think the workflow that you make is ownly assigned to the document library.   how can my workflow see, in witch folder i added  a new document and send a mail to this user? can i check this by a if statement, if yes how excactly.

Restricting user permission to upload doc but not create new folder


Hi all,

was wondering if it's possible to allow a user to upload documents but not be able to create a new folder...

Any help is greatly appreciated.


Create App_Data Folder Grayed Out?


I have a few questions regarding the "special" ASP.NET folders in Visual Studio web projects.

  1. Adding an App_Data folder in Visual Studio is present, but grayed out in my C# web project, why?
  2. What are the meanings of the various ASP.NET "special" folders?
    • App_GlobalResources
    • App_LocalResources
    • App_Data
    • App_Browsers
    • Themes - I know this is used to contain stylesheets for a particular theme and is then specified in the web.config or page (if I remember right).
    • App_Code - Were these classes that were pre-compiled?
  3. Do these ASP.NET folders retain their special meaning if you manually create a folder with the same name instead using the "Add ASP.NET Folder" feature in Visual Studio?

How to create a new folder with contains of note pad in every time

<!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->

Hello every one,

How to create a new folder with contains of note pad in every time. I mean if I am clicking on a new folder it’s automatically creates with notepad in that new folder. Please help me any one.


Thanks in advance




Programmatically create a package... in silverlight?


I've succesfully managed to programmatically create and alter packages, but now I was wondering if it would be possible to do this in a fancy Silverlight 4 application.

Because you can't reference the Microsoft.SQLServer.ManagedDTS.dll assembly in Silverlight, I tried the AutomationFactory.CreateObject("ProgId") approach.

That's where I got stuck. What's the progid, and is this actually possible?

can't create new mdf file in App_Code folder


I just installed vwd express 2008 and SSE 2008.  For SSE i setup a default installation (i.e. SQLEXPRESS as the default instance name etc). 

In VWD when i right-click on the "App_Data" folder and select "Add New Item--->SQL Server Database" i get the following message:

"  Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.  Please verify the installation of the component or download from the URL: ............."

So to get around that what i've done is select the "Database Explorer" tab and right-click on "Connections--->Add Connection".  This process works for me but the other doesn't.  Any idea why?

One problem with the 2nd approach is now that database appears in the database explorer for any project i have open in VWD.  Again any idea why thats happening?

 If anyone could offer a suggestion as to why i can't add a new connection in the solution explorer as explained above that would be fantastic.

 Also - i don't know if it matters but i'm running a 64-bit version of vista and have installed the x64 version of SSE.



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