Yes, we can make controller as partial.
Lets create a mvc application. Now create a contolller and name it "ABCController".
Now make the controller as partial.
- using System.Web.Mvc;
- namespace HtmlInjectInMvc.Controllers
- {
- public partial class ABCController: Controller
- {
- public ActionResult Index()
- {
- return View();
- }
- }
- }
Now add another controller and name it xyzController. In xyzController.cs
- using System.Web.Mvc;
- namespace HtmlInjectInMvc.Controllers
- {
- public class xyzController: Controller
- {
- public ActionResult Index()
- {
- return View();
- }
- }
- public partial class ABCController: Controller
- {
- public ActionResult About()
- {
- ViewBag.Name = "Prmaod Kumar";
- return View();
- }
- }
- }
Now run the application.
Output


Hope enjoy this article.
Happy coding :)


Kiran ThakurPosted Jan 16, 2016, 12:33 AM EST
good one
Gowtham RajamanickamTOP 100Posted Apr 18, 2015, 8:05 PM EDT
Good one
NitinPosted Apr 12, 2015, 12:24 PM EDT
good one