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
  1. Home
  2. Web Development
  3. ASP.NET
  4. delete files after adding them? AND focus on a control...

delete files after adding them? AND focus on a control...

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netdatabase
3 Posts 2 Posters 0 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
    Support123
    wrote on last edited by
    #1

    Hi... Is it posible to delete a file (from a hard disk) after adding it into the database by clicking on a button. (the click event allready stores the file in the database) I want to delete the file (from the hard drive) using asp.net. BUT is it possible to do this using asp.net code??? I am very new to asp.net but have worked with c# before. (and a little vb.net --- but not much) 2nd question... als in ASP.net How do i gain focus on a control? (lets say "myTextBox") i thought it should work like this... myTextBox.Focus(); but this is not working... Why not? It seems to work in the form load but not on the button click event???

    "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

    S 1 Reply Last reply
    0
    • S Support123

      Hi... Is it posible to delete a file (from a hard disk) after adding it into the database by clicking on a button. (the click event allready stores the file in the database) I want to delete the file (from the hard drive) using asp.net. BUT is it possible to do this using asp.net code??? I am very new to asp.net but have worked with c# before. (and a little vb.net --- but not much) 2nd question... als in ASP.net How do i gain focus on a control? (lets say "myTextBox") i thought it should work like this... myTextBox.Focus(); but this is not working... Why not? It seems to work in the form load but not on the button click event???

      "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

      S Offline
      S Offline
      Sun Rays
      wrote on last edited by
      #2

      Hi, you can delete file if you are having permission to delete it. Create fileinfo object of that file and then delete it. And to set focus you can do below code. private void Set_Focus(string controlname) { string strScript; strScript = "<script language=javascript> document.all('" + controlname + "').focus() </script>"; RegisterStartupScript("focus", strScript); }

      Thanks, Sun Rays To get something you must have to try once. My Articles

      S 1 Reply Last reply
      0
      • S Sun Rays

        Hi, you can delete file if you are having permission to delete it. Create fileinfo object of that file and then delete it. And to set focus you can do below code. private void Set_Focus(string controlname) { string strScript; strScript = "<script language=javascript> document.all('" + controlname + "').focus() </script>"; RegisterStartupScript("focus", strScript); }

        Thanks, Sun Rays To get something you must have to try once. My Articles

        S Offline
        S Offline
        Support123
        wrote on last edited by
        #3

        Thank you i will try it :-)

        "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

        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