Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open modals from code behind #31

Open
gabryk91 opened this issue Jul 9, 2021 · 0 comments
Open

Can't open modals from code behind #31

gabryk91 opened this issue Jul 9, 2021 · 0 comments

Comments

@gabryk91
Copy link

gabryk91 commented Jul 9, 2021

I saw this is a common problem, I am used to open them from codebehind using an hidden button and a small piece of jscript, like this:

<button type="button" style="display: none;" id="btnModal" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#modalRegole">Launch demo modal</button>

<script type="text/javascript">
        function ShowModal() {
            $("#btnModal").click();
        }
    </script>

and this code behind call: ClientScript.RegisterStartupScript(Me.GetType(), "alert", "ShowModal();", True)

This works on all my other bootstrap project except the one where i'm using sb admin template.
I need to edit what the modal will show by changing its components texts and visibility and I don't know how to do this without using code behind. So I don't want to open them using attributes data-toggle and data-target.

Any help? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant