I have an MVC3 application which has a reference to DLL. This DLL is called up on exception. The DLL method which is called should return a viewname along with model.
Now the problem i am facing is
- I am not able to pass a model to a view from a DLL.
- The method which are used to pass a model like View() and RedirectToAction() are not accessible.
- The methods which are accessible are RedirectResult() and RedirectToRouteResult() which does not accept any model.
To Elaborate More.
I have an MVC application in a solution. In same solution i have an DLL in same solution. This DLL is used by MVC application. This DLL consists of a DLL reference of System.Web.MVC. Now i have a class with a method in the DLL as
public static ActionResult HandleException()
{
return ;
}
Here this method should use something like
return View(“SomeView”,SomeModel);
But this method (View()) is not accessible in a method of a class in DLL.
Yes, you can.
Add a reference to the DLL in Web.config, the specify the type and namespace in
@model.Your situation is unclear.
You’re probably looking for the
ViewResultclass.EDIT:
Classes aren’t methods