I have a little software that gets a parameter by posting it to the controller and return a view according:
if (TempData[Main.SELF_DEPOSIT_LAYOUT] != null && TempData[Main.SELF_DEPOSIT_LAYOUT] is SelfDepositInit)
{
var mainLayout = TempData[Main.SELF_DEPOSIT_LAYOUT] as SelfDepositInit;
Session["layoutSelfDeposit"] = mainLayout.Layout;
return View("~/Views/SelfDeposit/" + Session["layoutSelfDeposit"] + "/" + this.ControllerContext.RouteData.Values["action"].ToString() + ".cshtml", model);
}
My problem is what if the person who post the value is sending an incorrect value and the view/folder doesn't exists? In this case i want to submit a default folder.
How can it be achieved?