Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 06, 2012 08:44 AM by sanddy19
Aug 06, 2012 05:43 AM|LINK
Line 91: fbd.RootFolder = System.Environment.SpecialFolder.MyComputer;
Line 92: fbd.ShowNewFolderButton = true;
Line 93: if (fbd.ShowDialog() == DialogResult.Cancel) Line 94: return;
protected void Button1_Click(object sender, EventArgs e)
FolderBrowserDialog x = new FolderBrowserDialog();
what i want is if user click the button means it will open dialog with submit cancel button to select directory path not a file.and if user click submit button means the path will be stored in a string??
how to do this??
pls guide me friends
Aug 06, 2012 05:58 AM|LINK
Are you trying to use the FolderBrowserDialog in a web application? FolderBrowserDialog is a windows forms control and can be only used for a Windows Form. It will throw errors if you try to use it in a web application. On the web side there is no specific
control to select directory, although you can use the normal <input type="file"> html tag to select a file on the client machine.
Aug 06, 2012 06:13 AM|LINK
try the below to achive this without folderbrowsedialog,
Aug 06, 2012 06:14 AM|LINK
There is no asp control to select the particular folder. As a security measure (IE 7 onwards), this access to the client's system is forbidden. However, you can use custom client side control with some security priviledges.
Aug 06, 2012 06:32 AM|LINK
thanks for ur reply...is there possible to do this using asp.net controls????
pls provide that coding...
Aug 06, 2012 08:44 AM|LINK
As mentioned there is no ASP.NET control to select the directory - since HTML specification itself does not support it because of security issues. Please explain what you are trying to acheive by making the user select a directory on his local pc, so that
we can help you better.