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:
but if i try to read the file using the following code it works:
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
Code:
System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath("users.txt"), TextBox1.Text)
Code:
TextBox1.Text = System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("users.txt"))
Thanks