So not sure why this does not work. I have this in a button on my web form.
protected void btnSave_Click(object sender, EventArgs e)
{
using (StreamWriter sw = new StreamWriter("C:\\temp\\test.txt"))
{
sw.Flush();
sw.WriteLine(txtDescription.Text);
}
}
When I type something into that text box and click the save button, nothing happens. No matter if the file exists ahead of time or not.
Not really sure what I missed. I have tried closing the streamwriter after the write line but that doesn't seem to work either. I am wondering if there is something in my form that needs to be changed.