The studentBranchName would contain a integer value which will be related to the branchName in class Branch.
In my aspx page, I have a repeater whose data source is associated with the Student class. I want to display the branch name in the Eval method inside the repeater.
In my aspx page, I have a repeater whose data source is associated with the Student class. I want to display the branch name in the Eval method inside the repeater.
This description might be a little confusing, but is below this what you want?
Member
1 Points
3 Posts
Problem fetching the value of a complex List in Eval method
Sep 12, 2019 07:01 PM|siddharth2929|LINK
So I have a class called Student -
{
int rollNo {get; set;}
string name {get; set;}
int branchId {get; set;}
List<Branch> studentBranchName {get; set;}
}
And the class Branch -
{
int branchId {get; set;}
string branchName {get; set;}
}
The studentBranchName would contain a integer value which will be related to the branchName in class Branch.
In my aspx page, I have a repeater whose data source is associated with the Student class. I want to display the branch name in the Eval method inside the repeater.
How can I do that?
Contributor
3140 Points
983 Posts
Re: Problem fetching the value of a complex List in Eval method
Sep 13, 2019 03:24 AM|Yang Shen|LINK
Hi siddharth,
This description might be a little confusing, but is below this what you want?
If so, please refer to below code:
ASPX:
.CS:
Hope this would help you.
Best Regard,
Yang Shen
Member
1 Points
3 Posts
Re: Problem fetching the value of a complex List in Eval method
Sep 16, 2019 03:09 AM|siddharth2929|LINK
This was very helpful. Thanks a lot, you're a genius!
Member
1 Points
3 Posts
Re: Problem fetching the value of a complex List in Eval method
Sep 16, 2019 03:11 AM|siddharth2929|LINK
This was very helpful. Thanks a lot, you're a genius!