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
The Image control is standard Web Server control, which is used to display an image on a Web page. This control exists within the System.Web.UI.WebControl namespace. You set the Uniform resource Locator (URL) of the image with the ImageUrl property of the Image control. The alignment of the image in relation to other elements on the Web page is specified by setting the ImageAlign property.
Public properties of the image Class
AlternateText : Obtains or sets the alternate text displayed in the image control when the image is not available . Browsers that support the ToolTips featurs display this text as a tooltip.
DescriptionUrl : Obtains or sets the location to a detailed description for the image.
Enabled : Obtains or sets a value indicating whether the control is enabled.
Font : Obtains or sets the font properties for the text associated with the control.
GenerateEmptyAlternateText : Obtains or sets a value indicating whether the control generates an alternate text attribute for an empty string value.
ImageAlign : Obtains or sets the alignment of the image control in relation to other controls on the Web page.
ImageUrl : Obtains or sets the location of an image to where it display in the Image control.
Example of Image control in asp.net
First insert image in any folder or root folder of the website
The Image control is standard Web Server control, which is used to display an image on a Web page. This control exists within the System.Web.UI.WebControl namespace. You set the Uniform resource Locator (URL) of the image with the ImageUrl property of the Image control. The alignment of the image in relation to other elements on the Web page is specified by setting the ImageAlign property.
Public properties of the image Class
AlternateText : Obtains or sets the alternate text displayed in the image control when the image is not available . Browsers that support the ToolTips featurs display this text as a tooltip.
DescriptionUrl : Obtains or sets the location to a detailed description for the image.
Enabled : Obtains or sets a value indicating whether the control is enabled.
Font : Obtains or sets the font properties for the text associated with the control.
GenerateEmptyAlternateText : Obtains or sets a value indicating whether the control generates an alternate text attribute for an empty string value.
ImageAlign : Obtains or sets the alignment of the image control in relation to other controls on the Web page.
ImageUrl : Obtains or sets the location of an image to where it display in the Image control.
Example of Image control in asp.net
First insert image in any folder or root folder of the website
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" ImageUrl ="~/Img/images.jpg" />
</div>
</form>
</body>
</html>
Related Post
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" ImageUrl ="~/Img/images.jpg" />
</div>
</form>
</body>
</html>
Related Post
Comments
Post a Comment