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
"A group of characters known as string", Like "Hello World!". If you want to change in it, use StringBuilder class, which is a mutable string class. Mutable means, if you want create an object with some character value, also want to change in it further , that is possible with same object. So here we take StringBuilder class for appending string.<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button"
Width="68px" BackColor="#FFFF66" />
<div style="width: 88px">
<asp:Label ID="Label1" runat="server" Text="Label" BackColor="#FFCC66"
BorderColor="#CC0000"></asp:Label>
</div>
</form>
Business Logic Code
protected void Button1_Click(object sender, EventArgs e){
StringBuilder stringd = new System.Text.StringBuilder();
stringd.AppendLine("those are string.");
stringd.AppendLine(" [ ");
stringd.Append('H');
stringd.AppendLine(" ] ");
stringd.AppendLine("those are another string");
Label1.Text = stringd.ToString();
}
Comments
Post a Comment