c# - display one to many linqdatasource joined table records in asp.net listview -


i not informed on asp.net databinding @ , can't find or figure how databind sub-table records in list view. have been able link table keys in database, , relationship detected linqdatasource creation wizard. code below far/close have gotten, yaks "databinding: 'dynamicclass1' not contain property name 'prtitem'." error when page requested.

<%@ page title="" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="recentmnblg.aspx.cs" inherits="rwhifonline.prodtctvty.recentmnblg" %>  <asp:content id="content1" contentplaceholderid="headcontent" runat="server"> </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server">     <asp:linqdatasource id="linqdatasourcenotesandtags" runat="server" contexttypename="sitedbdatacontext" entitytypename="" select="new (pkid, notetext, notetags)" tablename="notes" orderby="pkid desc"></asp:linqdatasource>     <h3>notes</h3>     <asp:listview id="listviewnotes" runat="server" datasourceid="linqdatasourcenotesandtags">         <itemtemplate>             <div class="item">                 <br />                 <asp:label id="notetextlabel" runat="server" text='<%# eval("notetext") %>' />                 <br />                 prtags:                 <!--<asp:label id="prtagslabel" runat="server" text='<%# eval("prtags") %>' /> -->                 <% var prtags = (ienumerable)eval("prtags");                     foreach (object prtitem in prtags) { %>                      <asp:label id="prtagslabel" runat="server" text='<%# eval("prtitem.tagtext") %>' />                        <% } %>                 <br />             </div>         </itemtemplate>         <layouttemplate>             <div id="itemplaceholdercontainer" runat="server">                 <span runat="server" id="itemplaceholder" />             </div>         </layouttemplate>     </asp:listview> </asp:content> 

the commented bit displays: "system.data.linq.entityset`1[notetag]" in label when page rendered without of foreach attempt section.

i have seen few pages searches using databound event gets list separate page call returns list of data items, seems excessive when there linq entity record right there. ideas or pointers using entities in databinding contexts?

was able call page code behind method ilist argument , return required string formatted list each linq-ed record


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -