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 Adrotator control displays a sequence of images, known as advertisements, on a Web page. The sequence in which the images appear can be predefined or random in nature. These advertisements, which all Internet users are familiar with, are image files in GIF, JPEG, or other format that the user can click to navigate to the advertiser's website.
Public Properties of the Adrotator Class
AdvertisementFile : Obtains or sets the path to an XML document that contain advertisement information.
Design a xml file for advertisements name as "advertisements.xml"
The Adrotator control displays a sequence of images, known as advertisements, on a Web page. The sequence in which the images appear can be predefined or random in nature. These advertisements, which all Internet users are familiar with, are image files in GIF, JPEG, or other format that the user can click to navigate to the advertiser's website.
Public Properties of the Adrotator Class
AdvertisementFile : Obtains or sets the path to an XML document that contain advertisement information.
Design a xml file for advertisements name as "advertisements.xml"
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>security.JPG</ImageUrl>
<Width>
200px
</Width>
<Height>
200px
</Height>
</Ad>
<Ad>
<ImageUrl>images.JPG</ImageUrl>
<Width>
100px
</Width>
<Height>
200px
</Height>
</Ad>
</Advertisements>
Drag and drop adrotator control onto the design window from toolbox
<Advertisements>
<Ad>
<ImageUrl>security.JPG</ImageUrl>
<Width>
200px
</Width>
<Height>
200px
</Height>
</Ad>
<Ad>
<ImageUrl>images.JPG</ImageUrl>
<Width>
100px
</Width>
<Height>
200px
</Height>
</Ad>
</Advertisements>
<%@ 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:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/advertisements.xml" />
</div>
</form>
</body>
</html>
Output
<!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:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/advertisements.xml" />
</div>
</form>
</body>
</html>
Comments
Post a Comment