Q:

How to verify datatype in C# asp.net MVC

I pass the custom data type of C# struct and now I want to get know which type it is in the attribute I put on them   in  ActionFilterAttribute.
How  can I check the type of viewdata.Model in ActionFilterAttribute?

A:

filterContext.ParentActionViewContext.ViewData.Model.GetType();

This will give you type of the model

