mercredi 15 mars 2017

How to Pass parameter to partiaView with return View(.....)

Iam totaly new mvc programmer and have some problem with my code. From my controller calling/returning to a partial view like that..and its working: Below is my code:

return View("~/Views/Partials/_CarModels.cshtml, new RenderModel(carsrent) );

I want now to pass a parameter color to partialview, i have tryed this and i get Error

return View("~/Views/Partials/_CarModels.cshtml?color=red", new RenderModel(carsrent) );

What is worong ?

Aucun commentaire:

Enregistrer un commentaire