Hello,
I created a webform to send to email using chapter 9 instructions (
http://www.surroundtech.com/events/msteched/Survey.aspx) and runs perfect on my local computer, however, when I upload (we use godaddy) and try to submit the survey this is the error I receive:
Server Error in '/www' Application.
Could not find file 'D:\Hosting\3714623\html\www\App_Data\Survey.txt'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not find file 'D:\Hosting\3714623\html\www\App_Data\Survey.txt'.
Source Error:
Line 71:
Line 72: string fileName = Server.MapPath("~/App_Data/Survey.txt");
Line 73: string mailBody = File.ReadAllText(fileName);
Line 74:
Line 75: mailBody = mailBody.Replace("##JobTitle##", JobTitle.Text);
Source File: d:\hosting\3714623\html\www\Events\MSTechEd\Survey .aspx.cs Line: 73
Stack Trace:
[FileNotFoundException: Could not find file 'D:\Hosting\3714623\html\www\App_Data\Survey.txt'.]
I had to change the whole site to use 3.5 framework because of compatibility problems at the server - but same error with 4.0.
Not sure why this is happening and if there's a way to fix it.... Thanks,