I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
The meaning of mouse enter and mouse leave are, when your cursor enter your object bounary then mouse enter method raised similarly when your cursor goes out of your object boundary then mouse leave method raised. I will give you an example of mouse enter and mouse leave method. Lets see the example, in this, we have division, when your cursor move on your divison boundary then division background changed also text of division will be changed. This also contain mouseleave() method with the same functionality.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default22.aspx.cs" Inherits="Default22" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script>
$(document).ready(function()
{
$('div').mouseenter(function () {
$(this).css('background-color', 'green');
$(this).html('MY website dotprograming.com')
});
$('div').mouseleave(function () {
$(this).css('background-color', 'red');
$(this).html('MY Blog dotprogramming.blogspot.com');
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height:50px;width:50px">
Hello World !
</div>
</form>
</body>
</html>
Code generates the following output
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default22.aspx.cs" Inherits="Default22" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script>
$(document).ready(function()
{
$('div').mouseenter(function () {
$(this).css('background-color', 'green');
$(this).html('MY website dotprograming.com')
});
$('div').mouseleave(function () {
$(this).css('background-color', 'red');
$(this).html('MY Blog dotprogramming.blogspot.com');
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height:50px;width:50px">
Hello World !
</div>
</form>
</body>
</html>
Code generates the following output
Comments
Post a Comment