How to display a modal using the compoent button of C # and bootstrap?

0

If you use <button type="button" data-toggle="modal" data-target="#ConvenioOk">Teste </button> , modal opens. But I have to use the C # button because of the event. The button calling the modal is thus <asp:Button ID="btnCadastrarCon" runat="server" data-togggle="modal" data-target="#ConvenioOk" Text="Cadastrar" OnClick="btnCadastrarCon_Click" />

Is there any way to use modal with the asp button, even without using the bootstrap? If so, can you give examples?

    
asked by anonymous 08.12.2015 / 02:24

2 answers

1

You can display your modal from backend using ScriptManager :

ScriptManager.RegisterStartupScript(this, GetType(), "LaunchServerSide", "$(function() { funcaoQueExibeModal(); });", true);

In your aspx:

function funcaoQueExibeModal() {
            $('#minhaModal').modal();
        }
    
07.10.2016 / 21:53
0

Certainly, however you will have to build your own modal. That is, intercept the click on the browser, create JavaScript / CSS to display the modal. In my opinion it gives more work, but follows an example:

link

    
08.12.2015 / 12:07