我是MVC的新手,所以我不知道这是什么方法: 我希望在一个标签上悬停时,其他标签会根据集合生成通过鼠标悬停的JavaScript,像这样的东西返回:从控制事件中获取javascript的结果
<script....
function getSongs(genreId)
{ return collection of Song objects }
</script>
<div>
@foreach(Genre genre in Genres)
{
<div> <label onmouseover= "here send @genre.Id to the function that will handle this and that will return a collection of Song objects"> @genre.Text </label> </div>
}
</div>
<div>
@foreach(Song song in the collection returned by the js function)
{ <div> <label> @song.Title </label> </div> }
</div>
我写到这里这个例子中,并没有从VS粘贴,很抱歉,如果有一些语法错误。 这将是什么正确的方法,如果这是正确的做法,那么这应该如何完成?谢谢