0

I have a view in which i m using tuple of two classes to render it like this.

@model Tuple<SAP.DTO.ViewData.IndentmstViewData, SAP.DTO.ViewData.IndentdetViewData>

and i am passing data from controller

            IndentmstViewData model1 = new IndentmstViewData();
            IndentdetViewData model2 = new IndentdetViewData();
            var model = new Tuple<IndentmstViewData, IndentdetViewData>(model1, model2);
            model.Item1.GetMenuData = GetMenuByUser();
            return View(model);

But in my layout page i used a partial page to render menu,partial page model used :

@model SAP.DTO.ViewData.BaseViewData

And when i run the application it throws an error :

The model item passed into the dictionary is of type 'System.Tuple`2[SAP.DTO.ViewData.IndentmstViewData,SAP.DTO.ViewData.IndentdetViewData]', but this dictionary requires a model item of type 'SAP.DTO.ViewData.BaseViewData'.

VillageTech
  • 1,968
  • 8
  • 18
addu
  • 1
  • 1

0 Answers0