BorHunter
BorHunter

Reputation: 923

How to get value of table instead of Id

I have asp.net project where try to get data from asp:repeater. In This moment I get value using <%# Eval("CategoryId") %>, but I need instead of Company.CategoryId get Company.Category.CategoryId, how can I do this in asp.net? In MVC I'm using DisplayFor(x => x.Company.Category.CategoryId), does here have smth similar?

This is the next part of https://stackoverflow.com/questions/23193852/how-to-display-value-in-asprepeater

Upvotes: 0

Views: 72

Answers (1)

Palak Bhansali
Palak Bhansali

Reputation: 731

you can evaluates object properties like below,

<%# ((Company)(Container.DataItem)).Category.CategoryId %>

Upvotes: 1

Related Questions