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
In this article i will show you how a button control behaves as fileupload control. Example of button control working as fileupload control. In this article i taken a button and fileupload control but visibility of fileupload is hidden. Get the fileupload control by their id property in JQuery and put the accessed file path into label control. Let see the example
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script>
$(function(){
$("#fileupload1").change(function () {
$("#l1").html($("#fileupload1").val().substring($("#fileupload1").val().lastIndexOf("\\") + 1));
});
})
</script>
</head>
<body>
<form id="form1">
<input type="file" style="display:none" id="fileupload1"/>
<input type="button" id="Button1" onclick='$("#fileupload1").click()' value="upload"/>
<label id="l1"></label>
</form>
</body>
</html>
Code generate the following output
Comments
Post a Comment