I need to create the body of a email in html format. Inside a HistoryController I define a metod that return an object (Course) which attributes will be used for crate the body as i said. I dont know how to get the object in the View. I've seen a metod using ActionResult but i dont to present the View it just work like an auxiliary for creating the email.
I get this.
HistoryController
public static CURSO courseSelected = new CURSO();
public static CURSO courseSel()
{
courseSelected.Name = "Physics";
return courseSelected;//cursoSelected del tipo CURSO
}
View
@model Project.Models.Course
@{
var courseSel = Project.Models.HistoryController.courseSel();
}
<fieldset class="fHorizontalCenter">
<label style="font-size:18px">Welcome to course of </label><label>@courseSel.Name</label>< br />
</fieldset>
But i cant use de data of the variable, It always prints this
Welcome to course of @courseSel.Name