ASP.NET Learning: DataList

xiaoxiao2021-03-06  107

DataList control application. You can handle users click event. In the ASPX code:

DataList2.datasource = ds.tables ["khda"]. DefaultView; DataList2.DATABIND ();

Void DataList_ItemCommand (Object Sender, DatalistCommandeventArgs E) {DataList2.Selected Index = E.Item.itemindex; Bindlist ();} The original display: Click on its "Details" to display the following: Of course, you want to set in DataList: SelectedItemTemplate < TD> Details Customer Name: <% # DataBinder.eval (Container.DataItem, "KHMC")%>
Address: <% # DataBinder.eval (Container. DataITEM, "KHDZ")%>
Customer Phone: <% # DataBinder.eval (Container.DataItem, "KHDH")%>
Registration Date: <% # ((DateTime) DataBinder.eval (Container. DataItem, "DJRQ"))%> also: ItemTemplate setting: <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%> <% # databinder.eval (container.dataitem, "khbh")% > <% # Databinder.eval (container.dataitem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

<% # DataBinder.eval (Container.DataItem, "khbh")%> <% # databinder.eval (container.DataItem, "khmc")%>

转载请注明原文地址:https://www.9cbs.com/read-100477.html

New Post(0)