<asp:Repeater id="BigBoard" runat="server">
<HeaderTemplate>
<table width="95%" border="0" cellspacing="0" cellpadding="3" align="center" class="tableBorder">
<tr>
<th width="55%" height="23" align="left">
论坛列表</th>
<th width="45%" align="left">
操作</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr align="left">
<td height="22" class="forumrowHighlight"><img src="Images/plus.gif">sdf(1)
</td>
<td height="22" class="forumrowHighlight">添加版面 | 修改版面 | 删除版面</td>
</tr>
<asp:Repeater id="SmallBoard" runat="server">
<ItemTemplate>
<tr align="left">
<td height="23" class="Forumrow"> <img src="Images/nofollow.gif"> sdf(1)</td>
<td height="23" class="Forumrow">高级设置 | 修改版面 | 删除版面 | 认证用户</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
Dim SQL As String
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("LDBBS.mdb")
Conn.Open() SQL = "Select * From Board Where ParentID=0"
Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter(SQL, Conn)
Dim DS As DataSet = New DataSet
Adapter.Fill(DS)
Adapter.Dispose() '];//释放
BigBoard.DataSource = DS.Tables(0).DefaultView
BigBoard.DataBind()
End Sub Protected Sub BigBoardCreade(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
Dim SQL As String
Dim BoardID As Integer
Dim Adapter As OleDbDataAdapter
Dim DS As DataSet
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim thisRow As DataRowView = CType(e.Item.DataItem, DataRowView)
If Not (thisRow Is Nothing) Then
BoardID = Convert.ToString(thisRow("BoardID"))
SQL = "Select * From BoardID Where ParentID=" & BoardID
Adapter = New OleDbDataAdapter(SQL, Conn)
DS = New DataSet
Adapter.Fill(DS)
Adapter.Dispose() '];//释放
SmallBoard.DataSource = DS.Tables(0).DefaultView
SmallBoard.DataBind()
End If
End If
End Sub我上面那样写代码找不到SMALLBOARD这个Repeater我的做法是嵌套中的那个Small Repeater,的数据要根据BigBoard Repeater的ParentID值来提取的SQL数据源的
可是代码中没认到 Small Repeater 这个控件
<HeaderTemplate>
<table width="95%" border="0" cellspacing="0" cellpadding="3" align="center" class="tableBorder">
<tr>
<th width="55%" height="23" align="left">
论坛列表</th>
<th width="45%" align="left">
操作</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr align="left">
<td height="22" class="forumrowHighlight"><img src="Images/plus.gif">sdf(1)
</td>
<td height="22" class="forumrowHighlight">添加版面 | 修改版面 | 删除版面</td>
</tr>
<asp:Repeater id="SmallBoard" runat="server">
<ItemTemplate>
<tr align="left">
<td height="23" class="Forumrow"> <img src="Images/nofollow.gif"> sdf(1)</td>
<td height="23" class="Forumrow">高级设置 | 修改版面 | 删除版面 | 认证用户</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
Dim SQL As String
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("LDBBS.mdb")
Conn.Open() SQL = "Select * From Board Where ParentID=0"
Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter(SQL, Conn)
Dim DS As DataSet = New DataSet
Adapter.Fill(DS)
Adapter.Dispose() '];//释放
BigBoard.DataSource = DS.Tables(0).DefaultView
BigBoard.DataBind()
End Sub Protected Sub BigBoardCreade(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
Dim SQL As String
Dim BoardID As Integer
Dim Adapter As OleDbDataAdapter
Dim DS As DataSet
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim thisRow As DataRowView = CType(e.Item.DataItem, DataRowView)
If Not (thisRow Is Nothing) Then
BoardID = Convert.ToString(thisRow("BoardID"))
SQL = "Select * From BoardID Where ParentID=" & BoardID
Adapter = New OleDbDataAdapter(SQL, Conn)
DS = New DataSet
Adapter.Fill(DS)
Adapter.Dispose() '];//释放
SmallBoard.DataSource = DS.Tables(0).DefaultView
SmallBoard.DataBind()
End If
End If
End Sub我上面那样写代码找不到SMALLBOARD这个Repeater我的做法是嵌套中的那个Small Repeater,的数据要根据BigBoard Repeater的ParentID值来提取的SQL数据源的
可是代码中没认到 Small Repeater 这个控件
protected System.Web.UI.WebControls.Repeater SmallBoard;
protected System.Web.UI.WebControls.Repeater SmallBoard;这是手动添加的,如果不手动,他不自己加进去呀楼上的,有没有方法,分我还可以再加