1

WCF Service基本的に著者の名前を返す with a メソッドがあり、このList of stringsデータソースをマップしたいのですが、複数の著者がいるFormViewため、次の出力が得られます。System.String[]

FormViewリストを取得し、文字列内の要素をグループ化するように指示するにはどうすればよいですか,

    [DataContract]
public class PublicationDetail
{
    [DataMember]
    public string PubID { get; set; }
    [DataMember]
    public string Title { get; set; }
    [DataMember]
    public List<string> Authors { get; set; }
    [DataMember]
    public string Description { get; set; }
    [DataMember]
    public string Publisher { get; set; }
    [DataMember]
    public DateTime PubDate { get; set; }
}



        <ItemTemplate>
            ExtensionData:
            <asp:Label ID="ExtensionDataLabel" runat="server" Text='<%# Bind("ExtensionData") %>' />
            <br />
            Authors:
            <asp:Label ID="AuthorsLabel" runat="server" Text='<%# Bind("Authors") %>' />
            <br />
            Description:
            <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Bind("Description") %>' />
            <br />
            PubDate:
            <asp:Label ID="PubDateLabel" runat="server" Text='<%# Bind("PubDate") %>' />
            <br />
            PubID:
            <asp:Label ID="PubIDLabel" runat="server" Text='<%# Bind("PubID") %>' />
            <br />
            Publisher:
            <asp:Label ID="PublisherLabel" runat="server" Text='<%# Bind("Publisher") %>' />
            <br />
            Title:
            <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
            <br />

        </ItemTemplate>
4

1 に答える 1

2

以下のようにステートメントを変更します。

Authors:
<asp:Panel ID="pnAddTransition" runat="server" Visible="false">
    <asp:Label ID="AuthorsLabel" runat="server" Text='<%# String.Join( ",", ((List<string>)Eval("Authors")).ToArray()) %>' />
<br />
于 2013-01-12T17:41:12.400 に答える