1
I am searching for a way to avoid an error message when user happens enters for a page that needs a parameter:
namespace Projeto.WEB.Controllers
{
public class ModalidadeController : Controller
{
// GET: Modalidade
public ActionResult Index()
{
return View();
}
[HandleError(ExceptionType = typeof(OverflowException), View = "Home" )]
[HandleError()]
public ActionResult SelecionarModalidade(int id)
{
return View();
}
}
}
The problem if the user tries to enter directly on this page after it is recorded on his computer. In this case it would have some route to direct the user stating that it was not possible or direct him to the index
?
I took a test:
<customErrors mode="On" defaultRedirect="Error" />
Upshot: