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 }); }
It is an abstract class, therefore we cannot instantiate it directly. We can use OpenFileDialog or SaveFileDialog to open a file or to save a file respectively. Just run the open or save dialog boxes is not sufficient to open or save a file, we have to use I/O streams to do these simple tasks.
To open this dialog box just add an open file dialog control from toolbox and write openFileDialog1.ShowDialog(); in the click event of button.
To open this dialog box the same procedure will be followed up. Just add a SaveFileDialog and write saveFileDialog1.ShowDialog(); in the click event of button.
To open these type of dialog boxes we have to create an object of respective class and then call its ShowDialog() method:
FolderBrowserDialog Box Control
OpenFileDialog
To open an existing file and see the content of that file, OpenFileDialog box is used. It is same in all window application as shown in following image:To open this dialog box just add an open file dialog control from toolbox and write openFileDialog1.ShowDialog(); in the click event of button.
SaveFileDialog
To save a file after creating of modifying you have to save that file using SaveFileDialog box at the specified location. Following figure shows the preview of SaveFileDialog box.To open this dialog box the same procedure will be followed up. Just add a SaveFileDialog and write saveFileDialog1.ShowDialog(); in the click event of button.
To open these type of dialog boxes we have to create an object of respective class and then call its ShowDialog() method:
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();
openFileDialog.ShowDialog();
Comments
Post a Comment