Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27206

ASPX Webform write to text file

$
0
0
I'm trying to write to a text file when user clicks on a button on an ASPX page but it does not write to file also, does not return any errors. I'm using following code:

Code:

System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath("users.txt"), TextBox1.Text)
but if i try to read the file using the following code it works:

Code:

TextBox1.Text = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("users.txt"))
I have checked security permissions of the folder everyone has access to reading and writing. Anyone know what might have cause this issue or a better way to approach this?

Thanks

Viewing all articles
Browse latest Browse all 27206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>