Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Folder browser object in ASP.net

Folder browser object in ASP.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelpquestion
3 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Suj_78
    wrote on last edited by
    #1

    Hi Does any one know whether ASP.net has Folder Browser object. I know that windows application has got Folder browser object, i am looking for something similar in ASP.net so that when a user clicks a button to load a file to the web server, then a folder browser opens up. Can anyone help???? Your help will be highly appreciated.

    happy coding!

    S 2 Replies Last reply
    0
    • S Suj_78

      Hi Does any one know whether ASP.net has Folder Browser object. I know that windows application has got Folder browser object, i am looking for something similar in ASP.net so that when a user clicks a button to load a file to the web server, then a folder browser opens up. Can anyone help???? Your help will be highly appreciated.

      happy coding!

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      From my openion use html control instead of ASP control because you are going to upload the file from client to server and make it run at server ok for html use this one

      1 Reply Last reply
      0
      • S Suj_78

        Hi Does any one know whether ASP.net has Folder Browser object. I know that windows application has got Folder browser object, i am looking for something similar in ASP.net so that when a user clicks a button to load a file to the web server, then a folder browser opens up. Can anyone help???? Your help will be highly appreciated.

        happy coding!

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        hi i have the code for you void Button1_Click(object sender, EventArgs e) { // Get the HtmlInputFile control from the Controls collection // of the PlaceHolder control. HtmlInputFile file = (HtmlInputFile)Place.FindControl("File1"); // HtmlInputFile file = new HtmlInput HtmlInputFile(); // file.Value="@\\hd-yogeshv\Yogesh\sample.txt"; // Make sure a file was submitted. if (Text1.Value == "") { Span1.InnerHtml = "Error: you must enter a file name"; return; } // Save file to server. if (file.PostedFile != null) { try { file.PostedFile.SaveAs("c:\\MyPoc\\"+Text1.Value); Span1.InnerHtml = "File uploaded successfully to " + "<b>c:\\MyPoc\\" + Text1.Value + "</b> on the Web server"; } catch (Exception exc) { Span1.InnerHtml = "Error saving file <b>c:\\temp\\" + Text1.Value + "</b><br>" + exc.ToString(); } } } void Page_Load(object sender, EventArgs e) { // Create a new HtmlInputFile control. HtmlInputFile file = new HtmlInputFile(); file.ID = "File1"; // Add the control to the Controls collection of the // PlaceHolder control. Place.Controls.Clear(); Place.Controls.Add(file); }

        HtmlInputFile Constructor Example

        Specify the file to upload:Save as file name (no path):

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups