컨트롤 심층 설명 1
17095 단어 상세하게 해석하다
<
asp:datalist
id
="MyList"
runat
="server"
>
<
ItemTemplate
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=<%# DataBinder.Eval(Container.DataItem, "
id")%
>
" target="frmleft">
<
font
>
<%
# DataBinder.Eval(Container.DataItem,
"
name
"
)
%>
</
font
></
a
></
li
>
</
ItemTemplate
>
</
asp:datalist
>
:
<
div
id
="daohang"
>
<
table
id
="menuhead1_MyList"
cellspacing
="0"
border
="0"
style
="border-collapse:collapse;"
>
<
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=1"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
><
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=2"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
><
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=3"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
><
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=4"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
><
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=5"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
><
tr
>
<
td
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=6"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
td
>
</
tr
>
</
table
>
</
div
>
HTML code
<
asp:Repeater
id
="MyList"
runat
="server"
>
<
ItemTemplate
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=<%# DataBinder.Eval(Container.DataItem, "
id")%
>
" target="frmleft">
<
font
>
<%
# DataBinder.Eval(Container.DataItem,
"
name
"
)
%>
</
font
></
a
></
li
>
</
ItemTemplate
>
</
asp:Repeater
>
<
div
id
="daohang"
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=1"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=2"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=3"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=4"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=5"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
<
li
style
=" list-style-type:none;float:left;width:10%; margin:2px auto; "
>
<
a
href
="menuleft.aspx?id=6"
target
="frmleft"
><
font
>
</
font
></
a
></
li
>
</
div
>
datalist table . . repeater . . css , repeater datalist RepeatDirection="Horizontal" RepeatColumns="2"