I have this controller method:
public ActionResult GetPDF(string paramYear)
{
list = new List<Exam>
{
new Exam(){Year= "2016"},
new Exam(){Year= "2017"},
new Exam(){Year= "2018"}
};
return View(list.Where(a => a.Year == paramYear));
}
That return the following view GetPDF view:
<body >
<object data="~/Content/Exams/2016/T205_16.pdf" type="text/html" style="float:left;width:100%;height:100%;"></object>
</body>
I need the following: when the GetPDF method invoked I want that this part will replaced with the correct path data="~/Content/Exams/2016/T205_16.pdf"
For example, If GetPDF was invoked with "2018" the the path inside html will replaced to:
data="~/Content/Exams/2016/exam_2018.pdf"
How can I achive that? I tried to get the url paremer like here but it didn't worked well