从C#代码隐藏打开HTML模式弹出窗口

从C#代码隐藏打开HTML模式弹出窗口,c#,html,asp.net,C#,Html,Asp.net,我使用的是HTML模式 HTML <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content">

我使用的是HTML模式

HTML

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Server Message</h4>
            </div>
            <div class="modal-body">
                <div class="table-responsive">
                    <table class="table mb30">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>1</td>
                                <td>Return Message</td>
                                <td><asp:Label ID="Label1" class="col-sm-8 control-label" runat="server" Text="Label"></asp:Label></td>

                            </tr>
                            <tr>
                                <td>2</td>
                                <td>Return ID</td>
                                <td><asp:Label ID="Label2" class="col-sm-8 control-label" runat="server" Text="Label"></asp:Label></td>

                            </tr>
                            <tr>
                                <td>3</td>
                                <td>Return Status</td>
                                <td><asp:Label ID="Label3" class="col-sm-8 control-label" runat="server" Text="Label"></asp:Label></td>

                            </tr>
                        </tbody>
                    </table>
                </div>
                <!-- content1 end  -->
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
        <!-- modal-content -->
    </div>
    <!-- modal-dialog -->
</div>
<!-- modal -->

&时代;
服务器消息
#
1.
回信
2.
返回ID
3.
返回状态
接近
我试图使用C#代码隐藏函数打开这个模型

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none", "<script>$('#myModal').modal('show');</script>", false);
ScriptManager.RegisterClientScriptBlock(this,this.GetType(),“none”,“$('#myModal').modal('show');”,false);
由于某种原因,它不起作用。
我想在保存函数末尾显示此模式,并返回值。单击按钮可以打开此模式,但如何从C#函数打开此模式???

您可以这样做

创建一个JavaScript函数

<script>
    function ShowPopup()
    {
        $('#myModal').modal('show');
    }
</script>
ScriptManager.RegisterStartupScript(this, this.GetType(), "none", "ShowPopup();", true);