Suppose I have a view to display the list of employee like:
<table>
<% foreach (var item in Model)
{ %>
<tr><td>
<img name=<%="disp"+item.id%> alt="" src="../../Content/Disp.gif" />
</td></tr>
<% { %>
Then I want to set mouseover and mouseout event for the image to disp the employee info in a popup box. If the mouse is over the image, display employee info in the box. If the mouse is out of the image, close the info box.
Then I create controller action for ajax call to get employee data from database like:
public ActionResult AjaxDisp(int id, string format)
{
var obj= repository.GetEmployee(id);
if (format == "json")
return Json(obj);
return View(obj);
}
Then I need to write some jquery code for mouseover event to get the data from the action and code for mouseout to close popup box if it is showing on.
How to resolve this issue?