Code in global.asax.->
StreamReader reader = new StreamReader(HttpContext.Current.Server.MapPath("~/AutoMailSend.htm"));
above line shows the error-> Object reference not set to an instance of an object.
Thanks in advanced
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anupam SinghPosted Jul 24, 2014, 9:10 AM
Harshal ThakrePosted Jul 24, 2014, 6:45 AM
1.below code is working in any aspx.cs file
2.but it's not working in global.asax.
Anupam SinghPosted Jul 24, 2014, 6:07 AM
But there might be problem while accessing file :
Replace your ScheduledTask() method with
if (File.Exists("~/AutoMailSend.htm") // check file exists
{
}
Harshal ThakrePosted Jul 24, 2014, 4:04 AM
Anupam SinghPosted Jul 24, 2014, 3:43 AM