I have two controller actions, where one is used to return the view in a standard way and another returns a large chunk of the same view for use in, for example, a javascript modal somewhere else in my application. My question is what would be the best practise way to do this, or if the way I have done it is ok. Maybe I should move the duplicated code out to a helper method?
(Note the Create View has the _Create partial inside it)
Right now I have:
public ActionResult Create(int someParamater)
{
//Lots of code
return View(model);
}
public PartialViewResult GetCreatePartial(int someParameter)
{
//All of the same code as in Create
return PartialView("_Create", model);
}