Hi anjali600,
Refer below sample.
Model
public class BasicInfo
{
public string Name { get; set; }
public int Age { get; set; }
}
Controller
Home
public class HomeController : Controller
{
// GET: Home
public IActionResult Index()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Index(BasicInfo basic)
{
return RedirectToAction("Index", "Fetch", basic);
}
}
Fetch
public class FetchController : Controller
{
// GET: Fetch
public IActionResult Index()
{
return View();
}
[HttpGet]
public IActionResult Index(BasicInfo basic)
{
return View(basic);
}
}
View
Home
@model Sample_876692.Models.BasicInfo
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
@Html.AntiForgeryToken()
<h4>Basic Info</h4>
<table>
<tr>
<td>Name</td>
<td><input type="text" name="Name" /></td>
</tr>
<tr>
<td>Age</td>
<td><input type="text" name="Age" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Create" /></td>
</tr>
</table>
}
</body>
</html>
Fetch
@model Sample_876692.Models.BasicInfo
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<table>
<tr>
<td>Name</td>
<td>@Model.Name</td>
</tr>
<tr>
<td>Age</td>
<td>@Model.Age</td>
</tr>
</table>
</body>
</html>
Screenshot