I'm making a simple website in Asp.net MVC 4. I'm using default Identity models. There are many partial views that I am using.
The problem is that if someone passes the path to a partial view, the view opens up but all messed up (because it's a partial view). But I want to restrict anyone from opening a partial view except from some within some view and not by simply putting the link in the address bar and hitting enter..
For example the localhost:1234/abc/MainPage view may open the MainPage and this MainPage may open up a partial view (PView for example) but simply by putting localhost:1234/abc/PView should not open any view and should redirect to its parent view eg MainPage. Is there any method to do that? Similar to what we do for checking roles and authorization via Identiy model i.e. [Authorize] tag