Hi mukesh1,
Check the below example.
HomeController
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
Session["Home"] = "Welcome to ASPForums";
return View();
}
}
HomeView
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
Home Index Page
<hr />
<span>@Session["Home"]</span>
<br />
@Html.ActionLink("Send", "Index", "Default")
</div>
</body>
</html>
DefaultController
public class DefaultController : Controller
{
// GET: Default
public ActionResult Index()
{
Session["Default"] = Session["Home"];
return View();
}
}
DefaultView
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
Default Index Page
<hr />
<span>@Session["Default"]</span>
</div>
</body>
</html>
Screenshot