0

I am using a web page in which the user can browse and select folders. The folderbrowsedialogu works properly but the dialog appears behind the active page. The user has to either minimize or use alt-tab to select the browse dialog.

How can I bring the folder browse dialog to front or give focus ?

FolderBrowserDialog dialog = new FolderBrowserDialog();
DialogResult result = dialog.ShowDialog();

if (result == DialogResult.OK)
{
    myVal = dialog.SelectedPath;
}
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
user3057368
  • 1
  • 1
  • 3
  • This won't work. You are using some windows form component. This won't appear on the client. It's visible on your dev computer because the web server runs on your own session. If an external user connects, he won't see anything. Actually, you should read some documentation on how ASP.Net works, to understand the difference beteween a web application and a windows form application. – Steve B Jan 16 '14 at 11:02
  • Sorry..but is there any other way in which we can implement folderbrowsing in a web application? – user3057368 Jan 16 '14 at 11:21
  • I don't think this is possible to work with folders with web application. what are you trying to achieve? – Steve B Jan 16 '14 at 13:07

1 Answers1

0

Try This one Html Code :

        <input type="file" id="image">
        <img id="Photo"/>

JQuery Code :

       $(document).ready(function () {
        $('#image').focusout(function () {

            function readURL(input) {
                if (input.files && input.files[0]) {
                    var reader = new FileReader();

                    reader.onload = function (e) {
                        $('#photo').attr('src', e.target.result);
                    }

                    reader.readAsDataURL(input.files[0]);
                }
            }
            $("#image").change(function () {
                if ($('#image').val() != "No file chosen") {
                    readURL(this);
                }
                else {
                    alert("Please Insert Your Photo");                            
                }
            });
         });
Dinesh
  • 1,005
  • 5
  • 16
  • 38
  • I have too choose a folder not file.Is there any way to implement that in a web application? – user3057368 Jan 16 '14 at 11:34
  • I dont know how can do this but see this site http://slickupload.com/demos it is possible and one simple request if u get answer please post your answer here – Dinesh Jan 17 '14 at 11:50