How to show details view in mvc3?

Total Post:29

 1529  View(s)
Rate this:

HI i am new to mvc so if anyone can help me will be great basically i just want to display a partiular item details, my code

    private sneakerEntities    _sneaker_categoryDataModel = new sneaker_info.Models.sneakerEntities();
    public ActionResult Index()
        IList<sneaker> Releases = _sneaker_categoryDataModel.sneakers.ToList<sneaker_info.Models.sneaker>();
        return View("Releases", Releases);
    public ActionResult Details (int id)
        return View();

  1. Post:51

    Re: How to show details view in mvc3?

    You need to find it from Repository and display in your strongly typed view

    public ActionResult Details (int
       Sneaker snkr=_sneaker_categoryDataModel.sneakers.Find(id);
       return View(snkr);

    In Details.cshtml

    @model Sneaker

    //all view related code

      Modified On Apr-06-2018 05:25:06 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.