Avatar of mgmhicks
 asked on

Calling bootstrap modal window from asp.net

when I submit a form, I need to validate one of the fields and if all is good I would like to load a bootstrap modal verifing that they are sure.  That form has a cancel and submit button.   If they submit I want to run code behind to post the transaction, or cancel will close the confrim modal and leave them where they are.  Question is I am using the following script and I cant get the modal window to show.   Here is the code behind I am using and the code of the dummy modal window I am trying to get to work.

 Dim myPayment As New CheckPaymentService
        Dim mBankName As String = String.Empty
        If myPayment.CheckRouteNo(Trim(txtRouteNo.Text), mBankName) Then
            ClientScript.RegisterClientScriptBlock(Me.GetType(), "ClientScript", "$('#MainContent.basicModal1').modal('show'); ")
            ' continue with processing
            CheckBox1.Checked = False
            ClientScript.RegisterClientScriptBlock(Me.GetType(), "ClientScript", "bootbox.alert ('Invalid Route Number') ", True)
        End If

Open in new window

<div class="modal fade" id="basicModal1" tabindex="-1" role="dialog" aria-labelledby="basicModal" 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="false">Close</button>
                    <h4 class="modal-title" id="myModalLabel">Terms and Conditions</h4>

                <div class="modal-body">
                    <h3>I hereby authorize MGM Enterprises, Inc., dba The Apartment Gallery,  dba Waterford Associates, to debit my bank account through the electronic 

Automated Clearing House (ACH) network within one to three business days from the date of this payment. I am aware that in the event The Apartment Gallery  is unable 

to secure funds from my bank account for this transaction for any reason, including but not limited to, insufficient funds in my account or insufficient or 

inaccurate information I provided when I submitted the electronic payment, further collection action may be undertaken by The Apartment Gallery, including 

application of returned check fees to the extent permitted by law.  If the payment is returned by my bank, I am still responsible for making a payment on my The 

Apartment Gallery or Waterford Associates account.</h3>


Open in new window

Visual Basic.NETjQuery.NET ProgrammingBootstrap

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
Scott Fell

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck