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 }); }
Introduction
In this article i will show you how to validate select box using JQuery. Example of select box validation using JQuery. First to get the id of the select box then get the value of it.
Source Code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script>
$(function () {
$("#Button1").click(function () {
var a = $("#d1").val();
if(a=="0")
{
alert("Please select");
}
});
})
</script>
</head>
<body>
<select name="d11" id="d1">
<option value="0" >Select</option>
<option value="1">Apple</option>
</select>
<input id="Button1" type="button" value="button" />
</body>
</html>
Code generate the following output
In this article i will show you how to validate select box using JQuery. Example of select box validation using JQuery. First to get the id of the select box then get the value of it.
Source Code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.10.2.js"></script>
<script>
$(function () {
$("#Button1").click(function () {
var a = $("#d1").val();
if(a=="0")
{
alert("Please select");
}
});
})
</script>
</head>
<body>
<select name="d11" id="d1">
<option value="0" >Select</option>
<option value="1">Apple</option>
</select>
<input id="Button1" type="button" value="button" />
</body>
</html>
Code generate the following output
Comments
Post a Comment