以下代码没有错误,可以执行,就是radiobutton不能单选了,在客户端有了变化,应该社repeater的作用引起的,怎么能解决呢!??
错误样式http://219.157.180.250
前台:<asp:Repeater ID="face" runat="server">
<itemtemplate>
<asp:radiobutton id="facecon" value='<%# container.dataitem("imageurl") %>' runat="server"/>
<asp:Image ID="faceimage" ImageUrl='<%# container.dataitem("imageurl") %>' runat="server"/>
</itemtemplate>
</asp:Repeater>
后台:
public class face'留言中的表情
inherits webpage
protected withevents face as webcn.Repeater
protected withevents radiogroup as webcn.radiobuttonlist
protected withevents faceimage as webcn.image
sub page_init(sender as system.object,e as system.eventargs)
dim conn as new sqlconnection("server=(local);database=news;uid=sa;pwd=3312079")
dim strsql as string
strsql="select imageurl from messageimage order by id"
dim cmd as new sqlcommand(strsql,conn)
conn.open()
dim dr as sqldatareader=cmd.executereader()
face.datasource=dr
face.databind()
conn.close()end sub
end class
错误样式http://219.157.180.250
前台:<asp:Repeater ID="face" runat="server">
<itemtemplate>
<asp:radiobutton id="facecon" value='<%# container.dataitem("imageurl") %>' runat="server"/>
<asp:Image ID="faceimage" ImageUrl='<%# container.dataitem("imageurl") %>' runat="server"/>
</itemtemplate>
</asp:Repeater>
后台:
public class face'留言中的表情
inherits webpage
protected withevents face as webcn.Repeater
protected withevents radiogroup as webcn.radiobuttonlist
protected withevents faceimage as webcn.image
sub page_init(sender as system.object,e as system.eventargs)
dim conn as new sqlconnection("server=(local);database=news;uid=sa;pwd=3312079")
dim strsql as string
strsql="select imageurl from messageimage order by id"
dim cmd as new sqlcommand(strsql,conn)
conn.open()
dim dr as sqldatareader=cmd.executereader()
face.datasource=dr
face.databind()
conn.close()end sub
end class
不过,如果在一个行里面的话,那倒是可以实现
你可把你的单选框换成复选框组试试看.
RepeatColumns="ColumnCount"
RepeatDirection="Vertical|Horizontal"
RepeatLayout="Flow|Table"