Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. error accessing model from view

error accessing model from view

Scheduled Pinned Locked Moved ASP.NET
htmldatabasedesignhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xnaLearner
    wrote on last edited by
    #1

    So bit too late in the project to be at this but i'm tidying up my project to try and refine a error I am receiving. Where I was using some of my model classes for many methods in my HolidayCotroller, So im trying to just run one method from one model. renamed all the files and everything seems to be ok except for my index method In my View for Index im using @model HolidayBookingApp.Models.IndexModel but when i click on the below link in the UI: @Html.ActionLink("Holidays Remaining", "HolidaysRemaining") the error states: The model item passed into the dictionary is of type 'HolidayBookingApp.Models.IndexModel', but this dictionary requires a model item of type 'HolidayBookingApp.Models.HolidaysRemainingModel' So I change the model to: @model HolidayBookingApp.Models.HolidaysRemainingModel but it is still giving me the same error msg. So in my IndexModel.cs i created a new instance of the previous HolidayremainingModel.cs` HolidaysRemainingModel model = new HolidaysRemainingModel(); what now?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups