prevent partial view in mvc 5 c#

prevent partial view in mvc 5 c#

We can prevent the partial view in MVC 5 using  ChieldActionOnly attribute on Partial-view action method in the controller. The below example might help you.

   [ChildActionOnly]
   public PartialViewResult Partial(string id)
   {           
      return PartialView();
   }

ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Buy Books Online at Best Prices

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.