none
The model item passed into the dictionary is of type 'Panther.Web.Areas.PatientChart.Models.TrackOrdersViewModel', but this dictionary requires a model item of type 'Panther.Web.Models.OrdersTrackingViewModel' RRS feed

  • Question

  • ErrorMessage: The model item passed into the dictionary is of type 'Panther.Web.Areas.PatientChart.Models.TrackOrdersViewModel', but this dictionary requires a model item of type 'Panther.Web.Models.OrdersTrackingViewModel'.
    StackTrace:    at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value)
       at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary)
       at System.Web.Mvc.ViewUserControl`1.SetViewData(ViewDataDictionary viewData)
       at System.Web.Mvc.WebFormView.RenderViewUserControl(ViewContext context, ViewUserControl control)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    Monday, June 12, 2017 7:47 AM

All replies

  • Well the cshtml that is defined that you put together wants the model object it expects from one namespace while you are trying to pass into the cshtml the view the object that was derived in another namespace. You are clearly being told what is wrong

    https://forums.asp.net/1146.aspx

    There is the MVC section at the above fourm.

    PS: A namespace is all the names proceeding the name of the object,  and they are two different namespaces on the object you are trying to pass, and the one that is expected, have different namespaces.

    Monday, June 12, 2017 11:08 AM
  • Hi Model item passed into the dictionary is of,

    Thanks for posting here.

    For your question is more related to NVC, please post a new thread in MVC forum for suitable support.

    The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 13, 2017 2:06 AM