内置中继器与外部中继器相关的嵌入式中继器的问题

时间:2013-06-25 15:10:19

标签: asp.net vb.net

我正在努力将FolderID整数设置为FolderList集合上的FolderID属性。 FolderList绑定到外部转发器。我见过的大多数示例都使用DataTables而不是自定义集合。我环顾四周,找不到任何可以帮助我的东西。

'--------------------------------------------------------
'Protected Sub Page_Load()
'--------------------------------------------------------
'.
'.
'.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    '----------------------------------------------------
    'Output
    '----------------------------------------------------
    '.
    '.
    '.
    With Folders

        '------------------------------------------------
        'Data
        '------------------------------------------------
        '.
        '.
        '.
        .DataSource = New FolderList(1)

        '------------------------------------------------
        'Bind
        '------------------------------------------------
        '.
        '.
        '.
        .DataBind()

    End With

End Sub

'--------------------------------------------------------
'Protected Sub Folders_ItemDataBound()
'--------------------------------------------------------
'.
'.
'.
Private Sub Folders_ItemDataBound(sender As Object, e As RepeaterItemEventArgs) Handles Folders.ItemDataBound

    '----------------------------------------------------
    'Declarations
    '----------------------------------------------------
    '.
    '.
    '.
    Dim Item As Repeater = e.Item.FindControl("Files")

    '----------------------------------------------------
    'Output
    '----------------------------------------------------
    '.
    '.
    '.
    With Item

        Dim FolderID As Int32 = 1

        '------------------------------------------------
        'Data
        '------------------------------------------------
        '.
        '.
        '.
        .DataSource = New PageList(FolderID)

        '------------------------------------------------
        'Bind
        '------------------------------------------------
        '.
        '.
        '.
        .DataBind()

    End With

End Sub

1 个答案:

答案 0 :(得分:1)

Dim FolderID As Int32 = DataBinder.GetPropertyValue(e.Item.DataItem,“FolderID”)