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 }); }
Computer Programming : GridView, combination of rows and columns. Single row contains one or more then one cells. If you want to get cell value from GridView, select Gridview row first. After that you can get cell value/Text from selected rows. Step-1 : Bind GridView using SqlDataSource in ASP.NET Step-2 : Drag and drop one label control onto design window Step-3 : Select "Enable Selection" using show smart tag. Step-4 : Double click on Gridview and handle SelectedIndexChanged event protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } Step-6 : Write code for getting value from gridview cell protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Label1 .Text =GridView1 .SelectedRow .Cells [2].Text ; } Output Whole code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="sqldatabindgrid.aspx.cs" Inherits="sqldatabindgrid&qu