Folder and file view
-
Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS
-
Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS
You can use the FolderBrowserDialog or OpenFileDialog controls to provide dialogs that allow the user to select a folder/file. Or you can build your own custom one using comboboxes, treeviews and listviews. You'll need to handle the various changed events and populate them all appropriately when the users clicks and changes things. (Tip: You can set the auto complete source on a combo box to "FileSystem" to give a kind of explorer style directory typer box.) Probably easiest to just use the OpenFileDialog though.
Simon
-
Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS
Hi, You didnot mention which version of .Net are you working on? Anyways, if you are using .net 2.0 you can use fileupload control by which you can select the file same as you select in windows. Just add below code on page_load event. Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()"); Where button1 is the id of the button you want to open the browser window when being clicked and FileUpload1 is the id of the file upload control. But if you are using .net 1.1 you need to write code explicitely for opening window explorer like file selector. There are some classes defined in framework for that. Hope this will help. :) Cheers Shilpa
-
Hi, You didnot mention which version of .Net are you working on? Anyways, if you are using .net 2.0 you can use fileupload control by which you can select the file same as you select in windows. Just add below code on page_load event. Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()"); Where button1 is the id of the button you want to open the browser window when being clicked and FileUpload1 is the id of the file upload control. But if you are using .net 1.1 you need to write code explicitely for opening window explorer like file selector. There are some classes defined in framework for that. Hope this will help. :) Cheers Shilpa
Nope, he can't. From the message context it seems he is developing a desktop app, and you are talking Asp.Net ;)
Regards, Lev