User1868852945 posted
To send email I want to call a Controller that just sends the email and returns a string rather than invoking a view page.
At first, just to get the send email to execute, I call the Controller from a link on another page.
The error I get upon clicking on the link:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /SendEmail/SendEmail
The link:
window.open("/SendEmail/SendEmail?p_db_type=ss", "tab_test");
Controller class:
namespace SchemaTrack.Controllers
{
public class SendEmailController : Controller
{
private string s = "debug stop";
public String Index(string p_db_type)
{
SendEmailRepository sendEmailRepo = new SendEmailRepository();
sendEmailRepo.db_type = p_db_type;
sendEmailRepo.SendEmail();
return "Email has been sent.";
}
}
}
In debug I prove that the private string s gets reached ok. The error occurs right after clicking continue.
Why am I getting the 404 error? I have tried many combinations and can't get past the 404.
Thanks much if you can advise.