Formcollection in .net core

Formcollection in .net core

In this article, Formcollection in .net core is the most fundamental concept to retrieve form parsed values from view to controller’s action.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using VideoFile.Models;

namespace usingcsharp.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public IActionResult Index(IFormCollection obj)
        {
            Employee obj1 = new Employee
            {
              
            };
            return RedirectToAction("Show", obj1);
        }
     }
}

2021-10-03