私は.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)); 特定のキーのすべての値にアクセスして表示する必要があります。各行はすべての値にアクセスして表示する必要があります。 –