title: Avoiding user to navigate to a view by entering url in the browser
body: <p>I am stucked in a situation where I want to avoid user to navigate to a View by entering URL into the Browser.But can navigate to that view on clicking to a button whose action navigate to that view.</p>
  
  <p>For eg:I have a href link to an <strong>ActionResult(Create)</strong>.I want the user to navigate to this <strong>view(Create)</strong> when clicked on that link but not when it enters the url in the browser like <strong>(/Create)</strong>.</p>
  
  <p>I found some solutions on this portal like:</p>
  
  <p>1)Making the ActionResult private-But this results in <strong>Http:404 Page not found Error</strong> by both entering the URL in the browser and on clicking the link which navigates to Create ActionResult.</p>
  
  <p>referred links: <a href="https://stackoverflow.com/questions/3316316/is-it-i-possible-to-prevent-certain-partialviews-from-being-served-if-requested/3316545#3316545">Is it i possible to prevent certain PartialViews from being served if requested directly?</a>
  2)Using DataAnnotaion <strong>[ChildActionOnly]</strong> on the ActionResult Method.But this also doesnot gave me the desired result,it gave me an error too.<strong>The same error HTTP:404</strong>.</p>
  
  <p>3)I tried using <strong>ControllerContext.IsChildAction</strong> but it alwayz return value false whether i navigate to this ActionResult on link click or entering the URL so I cant judge what to do.if it returns true in one case or false in other I would have solved my problem by redirecting in any case.</p>
  
  <p><a href="https://stackoverflow.com/questions/9407172/asp-net-mvc-how-to-prevent-browser-from-calling-an-action-method">Asp.net mvc How to prevent browser from calling an action method?</a></p>
  
  <p>help me Guys..</p>