Public Class WebForm2
Inherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim baseCls As New DataClass
baseCls.F1 = "a"
baseCls.F2 = "b"
baseCls.F3 = "c"
Dim baseCls2 As New DataClass
baseCls2.F1 = "aa"
baseCls2.F2 = "bb"
baseCls2.F3 = "cc"
Dim dt As New List(Of DataClass)
dt.Add(baseCls)
dt.Add(baseCls2)
lvwMyList.DataSource = dt
lvwMyList.DataBind()
End Sub
End Class
<Serializable()> Public Class DataClass
Property F1 As String
Property F2 As String
Property F3 As String
End Class
/
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm2.aspx.vb" Inherits="WebTest.WebForm2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ListView runat="server" ID="lvwMyList">
<LayoutTemplate>
<table id="tb" runat="server" border="1" cellspacing="0" style="width: 500px;">
<tr id="tr1" runat="server" style="">
<td id="td1" class="head" rowspan="2" runat="server">
<asp:LinkButton ID="Literal5" runat="server" Mode="Encode" Text="カラム1" />
</td>
<td id="td2" class="head" colspan="2" runat="server">
<asp:Literal ID="Literal6" runat="server" Mode="Encode" Text="2、3カラム" />
</td>
</tr>
<tr id="tr2" runat="server" >
<td id="td3" class="head" runat="server">
<asp:LinkButton ID="Literal11" runat="server" Mode="Encode" Text="カラム2" />
</td>
<td id="td4" class="head" runat="server">
<asp:LinkButton ID="Literal12" runat="server" Mode="Encode" Text="カラム3" />
</td>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%# Eval("F1")%></td>
<td><%# Eval("F2")%></td>
<td><%# Eval("F3")%></td>
</tr>
</ItemTemplate>
</asp:ListView>
</div>
</form>
</body>
</html>