How to refresh the current page in MVC.
[HttpGet]
public ActionResult Request()
{
if (Session["type"] != null && Session["resulttype"] != null)
{
return View();
}
else
{
return null;
}
}
I want to refresh my page in else part. That is when return null value.
You can use Request.UrlReferrer.ToString()
[HttpGet]
public ActionResult Request()
{
if (Session["type"] != null && Session["resulttype"] != null)
return View();
else
return Redirect(Request.UrlReferrer.ToString());
}