My question: how can you safely edit and upload .aspx and other ASCII files on a Windows server?
A client wanted a phone number changed on his apsx/mssql website. I edited the .aspx files in a text editor, FTP'd them and got a form error. Re-uploaded the backup files and got a compiler error(?), I think.
The developer reverted to the old backup in its entirety, including the database.
I found that there was an error in one of his scripts but it wasn't the same as the error I got initially (it's a regex form field for a UK post code. His version swaps the password, by mistake, into that field, my edited script returns a 'bad post-code error', even when it's not.)
No, I often edit aspx files in notepad and FTP them up to the server. If you make a backup first and restore it, there should be no problems. Presuming you had a working backup. Hard to say without seeing the code though. But it should be safe to make file backups and edit in a text editor. You could have maybe had a incorrect page directive or something like that.
I wonder if WinSCP uploaded them in BINARY mode? That's the only other thing I could think of. Pretty unsettling, I must say. Edit a few files, get an error, upload the backup and the whole thing goes kaput
Absolutely no way to say without seeing the error, but it should generally work to do this as others have pointed out. Actually have monkeypatched a few things adding <script runat="server"> to fix some errors in real crisis. Don't try that at home.