我真的找了又找,没有找到答案。考虑到一篇文章可以有多个标记,我想将标记显示为逗号分隔的值,这样看起来像
Egypt, Sinai, Muslim Brotherhood
在编辑文章时显示在文本区域中。如果有助于回答的话,我会发布任何需要的代码。
我的型号是:
Partial Public Class be_Posts
<Key>
Public Property PostRowID As Integer
Public Property BlogID As Guid
Public Property PostID As Guid
<StringLength(255)>
Public Property Title As String
Public Property Description As String
<AllowHtml> Public Property PostContent As String
Public Property DateCreated As Date?
Public Property DateModified As Date?
<StringLength(50)>
Public Property Author As String
Public Property IsPublished As Boolean?
Public Property IsCommentEnabled As Boolean?
Public Property Raters As Integer?
Public Property Rating As Single?
<StringLength(255)>
Public Property Slug As String
Public Property IsDeleted As Boolean
Public Overridable Property be_PostTag As ICollection(Of be_PostTag)
Public Overridable Property be_Categories As ICollection(Of be_Categories)
End Class
以及be_PostTag模型
Partial Public Class be_PostTag
<Key>
Public Property PostTagID As Integer
Public Property BlogID As Guid
Public Property PostID As Guid
<StringLength(50)>
Public Property Tag As String
Public Property be_Posts As ICollection(Of be_Posts)
End Class
我正在使用一个现有的数据库和数据,这些模型是从“代码第一”数据库生成的。
我意识到我需要一个EditorTemplate,但除此之外我不知道该怎么做。我如何将多个值绑定到一个文本区域?
显示我所说内容的图片: