按钮点击问题上的页面加载

时间:2015-02-19 16:27:13

标签: c# asp.net

在下面的代码中我有一个按钮,当我点击一个按钮添加国家页面加载和模态弹出消失,请帮我解决问题。

 <form id="new" runat="server">
    <button id="Button2" class="btn btn-primary" data-toggle="modal" runat="server"   data-target="#DivCountry">Add Country</button>


     <div class="modal fade" id="DivCountry">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <form id="form1" enctype="multipart/form-data" role="form">
                                <div class="modal-header">

                                    <h4 class="modal-title">Add Country</h4>
                                </div>
                                <div class="modal-body">

                                 <div class="form-group">
                                    <div class="input-group">                                
                                    <span class="input-group-addon">COUNTRY:</span>
                                    <input type="text" style="width:50%" id="txtcountry"  name="nmcountry" class="form-control" runat="server" placeholder="Country" />
                                     </div>
                                </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                    <button type="submit" id="CountrySave" class="btn btn-primary">Save</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
    </form>

1 个答案:

答案 0 :(得分:0)

尝试删除&#39; runat =&#34;服务器&#34;&#39;从按钮。您的html被覆盖,因为服务器正在发回新页面。