我的ActionResult
中有一个简单的GenresController
,如下所示:
public ActionResult Browse(string genre)
{
var genreModel = db.Genres.Include("Books")
.FirstOrDefault(g => g.Name == genre);
return View(genreModel);
}
以下是ActionResult
@model bookStore.Models.Genre
@{
ViewBag.Title = "Browse";
}
<h2>Browsing genre: @Model.Name</h2>
<ul>
@foreach(var book in Model.Books)
{
<li>
<a href="???/@book.Id">@book.Name</a>
</li>
}
</ul>
我想要做的就是点击@book.Name
后,我希望从Details ActionResult
BooksController
重定向到text <- read_delim("textfile.txt", "\n", escape_double = F, col_names = F, trim_ws = T)
。有什么想法吗?