'Object' does not contain a definition for 'Action'

Asked

Viewed 1,215 times

0

I am using MVC 5 with Identity to login, appeared this error that so far could not find a solution.

Error happens in view _ExternalLoginsListPartial.cshtml

inserir a descrição da imagem aqui

1 answer

0


The error is probably in the place where the partial view call is made, which is passing an object that does not own the property Action for the view _ExternalLoginsListPartial.cshtml.

Probably in his _ExternalLoginsListPartial.cshtml you’re getting a model dynamic thus:

@model dynamic

And referencing the property Model.Action, the property being Action does not exist in the object you are passing from your controller to your partial-view.

return View(objeto_que_nao_possui_action);

or

 @Html.Partial("_ExternalLoginsListPartial", objeto_que_nao_possui_action)

Whereas objeto_que_nao_possui_action is the object to be investigated.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.