This question is an exact duplicate of:
- Highlighting an html document expression in Asp.net mvc using JavaScript 1 answer
I'm using asp.net mvc to display a .html document that I know exactly what it contains.
I have this method in my controller:
public ActionResult GetHtmlPage(string path)
{
return new FilePathResult(path, "text/html");
}
and I have this Simple view:
@{
ViewBag.Title = "ManageDocument";
}
<h2>ManageDocument</h2>
@Html.Action("GetHtmlPage", "myController", new { path = Model.documentPath })
The document is displayed with no problems. But i want to Highlight a specific sentence that I know it exists somewhere in the document.
What I mean is, I'm trying to implement a JavaScript code maybe to find that specific sentence i want to highlight in the document and highlight it! I read about window.find() in JavaScript but my asp.net solution doesn't seem to recognize it.
I'm using VS2015 Enterprise