我的DataGrid嵌套DataList(未解决)
我觉得我的例子和MSDN (saucer(思归)版)的大概是一致的,个人觉得问题出在为什么我的页面的dlReplyList在绑定前(就是击编辑按钮后)会是“未定义的值”的?如下图(上半):而saucer(思归)版的例子,在同一个断点,DataList实例ItemsList却是存在的(下半)页面框架:
<asp:DataGrid Width="80%"
DataKeyField="PostId" ID="dgPostList" runat="server"
AllowPaging="True" PageSize="10" AutoGenerateColumns="false"
OnPageIndexChanged="TrunPage" OnEditCommand="EditPost"
OnDeleteCommand=DeletePost OnUpdateCommand=UpdatePost OnCancelCommand=CancelPost>
<pagerstyle Mode="NumericPages" Position="TopAndBottom" HorizontalAlign="Center"></pagerstyle>
<columns>
<asp:TemplateColumn>
<itemtemplate>
<table id="tbPostRecord" bgcolor="#dfdfdf" width="100%">
... <div align="right">
<asp:ImageButton runat="server" ID="imgbtEdit" CommandName="edit" ImageUrl="images/edit.gif" AlternateText="编辑"></asp:ImageButton>
<asp:ImageButton runat="server" ID="imgbtDelete" CommandName="delete" ImageUrl="images/del.gif" AlternateText="删除"></asp:ImageButton>
......
<asp:DataList ID="dlReplyList" Width="100%" RepeatColumns=1
DataKeyField="PostId" RepeatDirection=Vertical runat="server"
OnEditCommand="EditReply" OnDeleteCommand=DeleteReply
OnUpdateCommand=UpdateReply OnCancelCommand=CancelReply
补充:asp教程,高级应用