Thursday, October 22, 2015

How to prevent partial page to access directly in asp.net MVC.

Use the ChildActionOnly Attribute on Action of your Controller. 
For example:

        [HttpGet]
        [ChildActionOnly]
        public ActionResult GetProductList() {
            var vm = new ViewModels.EntryListViewModel(Models.UIdentity.Id);
            return View(vm);
        }

No comments:

Post a Comment