I want to create a class that checks for different inputs.
In the controller, I have a simple type of ActionResult method.
public ActionResult Detail( int? id ) { ViewData["value"] = _something.GetValueById( id ); return View(); }
If you go to http://localhost/Home/Detail/3 , then the controller will return a view where it shows the available values ββby id (integer) from the model.
If the identifier is zero, the controller redirects me to all the values.
If you change the authentication route (for example, http://localhost/Home/Detail/3fx ) to a different data type, the controller will return a red page. (with exception)
I want to check if the ID is int or not to avoid a red page error (with a list of exceptions).
I saw that isNaN is only for a dual data type.
Sorry if my question is annoying.
source share