저는 .NET에 익숙하지 않으므로이 문제로 어려움을 겪고 있습니다. 리피터 컨트롤이있는 콘텐츠 페이지가 있습니다. 사전은 Dictionary<string, Dictionary<int,[object]>>
입니다. 내가 개체 속성에서 얻을 Repeater 컨트롤 내부의 컨트롤의 값을 원하는 - object.CandName
것, 후보자의 이름, 후보 전화는 것 object.Phone
등사전이있는 바인딩 리피터 <string, Dictionary <int, [object]>
나는 사전의 이러한 유형의 Eval
을 사용하는 방법을 잘 모르겠습니다 . 대부분의 예제는 Eval("Value")
을 가리키고 있지만 올바른 값을 제공하지는 않습니다. 친절하게 도와주세요!
<asp:Content ID="Content2" ContentPlaceHolderID="content" Runat="Server">
<div id="rcontent">
<table>
<tr>
<td>
<asp:Label ID="lblerror" runat="server" Text="" Visible="true" CssClass="alert"></asp:Label>
</td>
</tr>
</table>
<div id ="rptdiv">
<asp:Repeater ID="Repeater1" runat="server" EnableViewState="false">
<ItemTemplate>
<div id="Div3">
<table class="GridViewStyleNoBorder" width=750px cellspacing="0" border="0" >
<tr>
<td class="PagerStyle" colspan="4">
<asp:Label ID="lblName" Runat="server"
Text='<%= Need the value of the [object].objectproperty from dictionary here %>' />
</td>
</tr>
</table>
</div>
이 내 Page_Load
코드 뒤에이다 - BLDecision
는 사전과 사전 값이 올바른지 반환 내 비즈니스 레이어 코드입니다. 나는 그들을 디버그 모드로 점검했다.
코드 뒤에 :
Dictionary(int, Dictionary(int, InterviewFeedback)) ;
CandIntDetails = new Dictionary(int, Dictionary(int, InterviewFeedback))();
BLDecision objBLDecision = new BLDecision();
int ReqCategoryID = 0;
if (Request.QueryString["ReqCategoryID"] != null)
ReqCategoryID = int.Parse(Request.QueryString["ReqCategoryID"].ToString());
CandIntDetails = objBLDecision.GetCandidatesforReqCategory(ReqCategoryID);
Repeater1.DataSource = CandIntDetails;
Repeater1.DataBind();
내가 코드 숨김에서 사용하는 경우, 나는 aspx 페이지에서 Eval('<% ....%>')
을 할 수 있습니까?
미리 도움을 주셔서 감사합니다.
데이터 형식을보다 정확하게 설명해야합니다. 한 지점에서 'Dictionary>'이고 다른 한 단어는 Dictionary >'로 작업하고 있음을 의미합니다. 사전에 정확히 포함 된 것은 무엇이며 출력물을 어떻게 보이게할까요? 사전 키로 그룹화하거나 특정 키의 모든 값에 액세스하고 싶습니까? –
Jacob
이것은 : Dictionary (int, Dictionary (int, InterviewFeedback)); 특정 키의 모든 값에 액세스하여 표시하려고합니다. 각 행은 모든 값을 액세스하고 표시해야합니다. –