注意设置 DataList 模板中 LinkButton 的CommandName 属性为 "SelectSchool"
CS 文件代码
protected void DL_Select_ItemCommand(object source, DataListCommandEventArgs e)
}
html 页面代码:
<asp:DataList ID="DL_Select" runat="server" RepeatColumns="4" ShowFooter="False"
ShowHeader="False" Width="100%" OnItemCommand="DL_Select_ItemCommand">
<ItemTemplate>
<asp:LinkButton ID="lbtnSelect" runat="server" Text='<%#Eval("name")%>' CommandName="SelectSchool"></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
CS 文件代码
html 页面代码: