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 }); }
Getting and assigning content of elements in jQuery is very simple because of its in-built functions . JQuery provides many in-built functions that can be used to get content of any element and can set html part for any element. JQuery library contains many DOM related functions that make it easy to use and understand how it is working. Programmer can easily manipulate content of any element or attributes by using existing functions . In rare chances programmer have to write its own functions with collection of JQuery library functions. To get content of any element on the web-page, programmer can use following three mostly used functions: val(): get or set the value of forms field. text(): get or set the text content of selected elements. html(): get of set the whole content of selected elements including html markup. Lookout the following example through which we will use all three types of functions and show the values returns by them. $("#btn").click(funct