Problem loading bootsrap modal on asp button click

I've been trying to come up with a way to use asp validation controls, but also come up with a confirm yes or no modal when the user clicks the submit button.

So the user clicks submit button validation controls validate, and then this is what I am trying to run.  I've tried it both ways.

    Private Sub btnConfirm_Click(sender As Object, e As EventArgs) Handles btnConfirm.Click
        ' ClientScript.RegisterClientScriptBlock(Me.GetType(), "ClientScript", "$('#ConfirmModal').modal('show');", True)
        ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Confirm", "$('#confirmModal').modal('show'); ", True)

    End Sub

Open in new window


HTML

<div class="modal fade" id="ConfirmModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalTitle">Payment Confirmation</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            Are you Sure ?
                        </div>
                        <br />
                        <div class="row">
                           <div class="col-md-12">
                               <asp:Button runat="server" ID="btnChk" CssClass="ui-button" Text="Yes" />
                               <asp:Button runat="server" ID="btnCancel"  CssClass="ui-button" Text="No" />

                           </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>



        </div>

Open in new window


What is the best way to handle this.  I know I can build a confirm page, but that doesnt seem like the as (Nice??)
mgmhicksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mgmhicksAuthor Commented:
Why isn't the following line not bringing up the modal window.
It works with jquery, but not with code behind.


    Private Sub btnConfirm_Click(sender As Object, e As EventArgs) Handles btnConfirm.Click
        ClientScript.RegisterClientScriptBlock(Me.GetType(), "ClientScript", "$('#ConfirmModal').modal('show');", True)
    End Sub

Modal window is in above code.

thanks
mgmhicksAuthor Commented:
The answer is use  ScriptManager.RegisterStartupScript(Page, Me.GetType(), "ClientScript", "$('#ConfirmModal').modal('show');", True) rather than the clientscript object

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgmhicksAuthor Commented:
I found the answer at another service.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.