OnClientClick='return confirm()'
<asp:Repeater ID="Repeater1" runat="server" onitemcommand="Repeater1_ItemCommand" >
<HeaderTemplate>
<table border="1" width="100%">
<tr><th>
<input id="selectAll" type="checkbox" onclick="selectAllFun(this)" />全选</th>
<th>真实姓名</th>
<th>用户名</th>
<th>性别</th>
<th>证件类型</th>
<th>证件号码</th>
<th>备注</th>
<td>
<asp:Label ID="cz" runat="server" Text="操作"></asp:Label>
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr><td>
<input id="cbx" type="checkbox" runat="server" onclick="searchFun(this)" />
<asp:HiddenField ID="hf" runat="server" Value='<%# Eval("TID") %>' />
<asp:Label ID="bianhao" runat="server" Text="<%# (currentPage-1)*pagesize+Container.ItemIndex+1 %>"></asp:Label>
</td>
<td><%# Eval("TrueName")%></td>
<td><%# Eval("Tname")%></td>
<td><asp:Label ID="lbgender" runat="server" Text='<%# Eval("gender")%>'></asp:Label></td>
<td><asp:Label ID="lbtype" runat="server" Text='<%# Eval("cardtype")%>'></asp:Label></td>
<td><%# Eval("cardnum")%></td>
<td><%# Eval("beizhu")%></td>
<td>
<asp:linkbutton id="lbdel" runat="server" commandname="Delete" text="删除" OnClientClick='return confirm("是否确定删除?")' />
<asp:linkbutton id="lbupt" runat="server" commandname="Update" text="修改" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
代码挺多,问题很简单,<asp:linkbutton id="lbdel" runat="server" commandname="Delete" text="删除" OnClientClick='return confirm("是否确定删除?")' />,我想确认删除是弹出 OnClientClick='return confirm("是否确定删除"+<%# Eval("Tname")%>+"?")'-----可是这样直接删除了,不提示了,求大虾指教
------解决方案--------------------
OnClientClick='return confirm("是否确定删除"+<%# Eval("Tname")%>+"?")'
改成
OnClientClick=<%#"if(!confirm('" + Eval("Tname") + "?')) return false;"%>
------解决方案--------------------