jquery在asp.net中用modal确认

时间:2013-12-17 19:00:39

标签: javascript jquery asp.net twitter-bootstrap confirm

您好我有一个删除评论的链接按钮

<asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete" CssClass="CommentDeleteBtn"  href="#myModal3" role="button" data-toggle="modal" CommandArgument='<%# Eval("Yorum_ID") %>'  Visible='<%# Eval("Yorum_Sahibimi") %>' ToolTip="Sil">Delete</asp:LinkButton>

如您所见,我将“href =”#myModal3“role =”button“data-toggle =”modal“”添加到模态确认中。

我的模态框

<div id="myModal3" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                    <h3 id="myModalLabel3">blabla Header</h3>
                                </div>
                                <div class="modal-body">
                                    <p>Are You Sure</p>
                                </div>
                                <div class="modal-footer">
                                    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
                                    <button data-dismiss="modal" class="btn blue" onclick="return true;" >Confirm</button>
                                </div>
                            </div>

在链接按钮上单击模式框正在显示。但是在确认按钮上单击不是删除命令。关于返回值? (不是关于asp.net side delete命令)

1 个答案:

答案 0 :(得分:0)

尝试将UseSubmitBehavior =“false”添加到onclick返回true的按钮代码中。

<button data-dismiss="modal" class="btn blue" onclick="return true;" UseSubmitBehavior="false">Confirm</button>