0

How I can get an object in HTML?

I have this:

@Html.DisplayFor(model => model.Product.Keys.Where(x => x.TransactionID == model.TransactionID))

but here I have an object, and I want to display only one value.

I tried something like this:

@{
    var key = model.Product.Keys.Where(x => x.TransactionID == model.TransactionID);
}

but model name doesn't exist in the current context.

Any ideas?

1 Answer 1

1

You should to use Model

@{
    var key = Model.Product.Keys.Where(x => x.TransactionID == Model.TransactionID);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.