Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi how can I make browse button to let select folder instead of file in web page in c#.net.

thanks
Posted
Updated 2-May-11 22:52pm
v2
Comments
Ankur\m/ 3-May-11 3:40am    
ASP.NET? Are you talking about web application?
trilokharry 3-May-11 5:00am    
yes
Sandeep Mewara 3-May-11 4:41am    
Not clear.
trilokharry 3-May-11 5:00am    
it's for web page.

If ur having web application

then u can use FileUpload control.

If ur having windows application the use folderBrowserDialog control like

C#
DialogResult dgResult = folderBrowserDialog1.ShowDialog();
                if (dgResult == DialogResult.OK)
                {}
 
Share this answer
 
v2
Comments
trilokharry 3-May-11 4:53am    
It's for web page.
sorry for not to mention web page.
thanks
Ashishmau 3-May-11 5:02am    
so u can use FileUpload control
Use FileUpload control. You'll find it under the "Standard" controls in your toolbox.
 
Share this answer
 
Comments
Member 10594017 13-Feb-14 9:36am    
is there a folderupload control ?
You cannot select a folder to be uploaded to the server. You will rather have to upload multiple files.

You need a FileUpload Control[^] for the same. Check the MSDN link I have given and scroll down to the section 'Uploading Multiple Files at the Same Time'. Or check this article - Uploading Multiple Files in ASP.NET 2.0[^].

Hope this helps!
 
Share this answer
 
You can use file jQuery file uploader in your case for uploading folder in case of files. have a look at jQuery plugins first.
 
Share this answer
 
Use the FolderBrowserDialog class: MSDN[^]

FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
   {
   ...
   }
 
Share this answer
 
Comments
trilokharry 5-May-11 1:45am    
still I have no solution.
Is there anyone who can help me.
I would appreciate.

thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900