Question

I'm using FolderBrowserDialog on my web application in c#. It is working perfectly except one issue:

the FolderBrowserDialog open in the back of the web application and not in front of it.

The code is:

public void BrowseFolderButton_Click(object sender, EventArgs e) 
{            
    FolderBrowserDialog folderDlg = new FolderBrowserDialog();     
    folderDlg.ShowNewFolderButton = true;                       
    DialogResult result = folderDlg.ShowDialog();                        
    if (result == DialogResult.OK)  
    {                          
        textBox1.Text = folderDlg.SelectedPath;                  
        Environment.SpecialFolder root = folderDlg.RootFolder; 
    } 
 } 

for the second time the user click on the button it opens in the back. Any help will be appriciate!

thanks, Moran

Was it helpful?

Solution

FolderBrowserDialog will always popup at the Server side, the client/browser will never see it so client would hang there forever waiting for input...

In your case, both Client and Server on the same pc, this is why you saw the dialog working. As far as I know there are no components from Microsoft that allow to browse the Folders on Client side. But you can always try open source Solutions...

for instance: http://www.codeproject.com/Articles/21895/Directory-Browsing-in-ASP-Net-2-0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top