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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anupam SinghRank #643 · 3.7K reputationPosted Jul 23, 2014, 11:43 PM EDT
Harshal ThakreRank #9,158 · 210 reputationPosted Jul 24, 2014, 12:04 AM EDT
Anupam SinghRank #643 · 3.7K reputationPosted Jul 24, 2014, 2:07 AM EDT
But there might be problem while accessing file :
Replace your ScheduledTask() method with
if (File.Exists("~/AutoMailSend.htm") // check file exists
{
}
Harshal ThakreRank #9,158 · 210 reputationPosted Jul 24, 2014, 2:45 AM EDT
1.below code is working in any aspx.cs file
2.but it's not working in global.asax.
Anupam SinghRank #643 · 3.7K reputationPosted Jul 24, 2014, 5:10 AM EDT