954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FolderBrowseDialog Box

Hi,

Please suggest me to do FolderBrowserDialog box for "C# Web Application".

Thanks a lot,
Anjali

kanjali
Newbie Poster
13 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

why you need to develop it yourself as it exists? just add reference to System.Windows.Forms and use it in your web-based application.

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

Ya that's the great idea.
But iam getting this execption , can you please suggest me for this.

Exception : "Current thread must be set to single thread apartment(STA) before OLE calls can be made. Ensure that your main function has STAThreadAttribute marked on it . This exception is only raised if adebugger is attached to the process."

Thanks a lot,
Anjali

kanjali
Newbie Poster
13 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

Just because you debug, run your web-based application (Ctrl + F5) there is no exception.

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

Its not working properly with (ctr + f5) also. Its very slow and FolderDialog is opening but does not contains anything..

Please check out the bellow code n please suggest me for the same.

private void btnBrowse_Click(object sender, EventArgs e)
{
FolderBrowserDialog RootFile = new FolderBrowserDialog();
if(RootFile.ShowDialog() == DialogResult.OK)
{
txtRootFolder.Text = RootFile.SelectedPath.ToString();
}
}

Thanks a lot,
Anjali ...

kanjali
Newbie Poster
13 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

Authentication problem, I'll reply you ASAP.

Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You