日期:2014-05-17 浏览次数:20835 次
<ul>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li><%#Eval("id") %><asp:TextBox ID="TextBox1" Text='<%#Eval("title") %>' runat="server"></asp:TextBox></li>
</ItemTemplate>
</asp:Repeater>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="更新" />
</ul>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:label id=lab_id ruant=server text='<%#Eval("id") %>'/>
<asp:TextBox ID="TextBox1" Text='<%#Eval("title") %>' runat="server"></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="更新" />
for (int i=0 i<rep1.items.count;i++)
{
string id=(rep1.items[i].findcoutrol("labid") as label).text;
string title=(rep1.items[i].findcoutrol("textbox1") as textbox).text;
string sql="update table set title ='"+title+"' where id="+id
//执行sql