delete files after adding them? AND focus on a control...
-
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
-
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
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
-
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
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