日期:2014-05-16  浏览次数:20457 次

求大神,DataList里怎么用点击LinkButton删除数据


如图,我想在显示的DataList里实现点击LinkButton删除按钮即可执行后台代码里的删除选择的数据,可惜不知道怎么把前台的<%#Eval("Title")%>传到我的sql语句??处,或者可以用其他什么方法传值过去?谢谢各位大神!


前台代码:
        <asp:DataList ID="DataList2" runat="server">
            <ItemTemplate>
                <table class="style1">
                    <tr>
                        <td>
                            <a href='<%#"Reading.aspx?title="+ Eval("Title") %>'><%#Eval("Title")%></a>
                        </td>
                        <td>
                            <a href='<%#"Write.aspx?title="+ Eval("Title") %>'>[编辑]</a>
                        </td>
                        <td>
                            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">[删除]</asp:LinkButton>
                        </td>
                    </tr>
                    <tr>
                    <td>
                         <a style=" font-size:12;">[<%#Eval("Datetime")%>]</a>
                    </td>
                    </tr>
                    <tr></tr><tr></tr>
                </table>
            </ItemTemplate>