@model List<testmvc4.data.country>
@{
ViewBag.Title = "SearchView";
}
<script type="text/javascript" src="../../Scripts/jquery-1.7.1.min.js">
</script>
<script type="text/javascript">
function toggal(value,counts) {
$(document).ready(function () {
$("#panel-" + value).slideToggle();
for (i = 0; i < counts; i++) {
if (i != value) {
$("#panel-" + i).slideUp();
}
}
});
}
</script>
<h2>SearchView</h2>
<table style="width:60%">
<tr>
<th>Country ID</th>
<th>Country Name</th>
</tr>
@foreach (var country in Model)
{
<tr>
<td>
<img id="flip @country.CountryID" onclick=" return toggal(@country.CountryID,@Model.Count);" style="padding:5px;<br mode=" hold=" />text-align:center;<br mode=" runat="server" src="../../Images/bullet.png" height="20" width="20" />
div id="panel-@country.CountryID" style="padding:50px;display:none; <br mode=" hold=" />text-align:center;<br mode=">Hello world!</div>
</td>
<td>@country.CountryID</td>
<td>@country.CountryName</td>
</tr>
}
</table>
}</testmvc4.data.country>