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 }); }
Size restriction protects your web application from malicious users. They will upload numerous large files to your Web server. So Developers take the default size limitation is 4MB. The transfer fails if a user tries to upload a file that is larger then 4096kb. Now, if you want to change the default size limitation, you make some changes in either the root we.config file , which is found in that path (c:\Windows\Microsoft.NET\Framework\v4.0.xx\config) or in your application's web.config file.
maxRequestLength= 11000
The user can upload around 10mb files using file upload control. Also must to change the executionTimeout property, This property sets the time ( in seconds ) for a request to attempt to execute to the server before ASP.NET shuts down the request. try this into your web.config file
<system.web>
<httpRuntime executionTimeout ="300" maxRequestLength ="11000"/>
</system.web>
How to Increase uploaded file size
<httpRuntime> section takes different properties but two properties , The maxRequestLength and executionTimeout properties are very nice. If you want to change the default uploaded file size then you must to change the value of maxrequestLength. It take the size in KiloBytes. Lets take a simple syntax here.maxRequestLength= 11000
The user can upload around 10mb files using file upload control. Also must to change the executionTimeout property, This property sets the time ( in seconds ) for a request to attempt to execute to the server before ASP.NET shuts down the request. try this into your web.config file
<system.web>
<httpRuntime executionTimeout ="300" maxRequestLength ="11000"/>
</system.web>
Comments
Post a Comment