Hi
I was trying to call open modal function using code behind call in ASP.NET
But it is not working.
This is javascript code :
function openModal() {
$('#modal').modal('open');
}
Now code in code behind is :
ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
But it is not working.
For javascript alert, bootstrap modal it is working.
Please help ....
Please do not mix Bootstrap with Materialize, they collide, cause a black hole and destroy the whole humanity.
Are there any errors in your (browser) console and was the component initialized before calling the open method? Which version of Materialize do you use?
I'm using v0.98.0.
The console does not show any errors it just gets postbacked as I am using ASP buttons.
modal : The modal name
**function openModal() {
$('#modal').modal('open');
}** : The javascript to open modal(It is working if I directly use a target on it)
Now code in code behind is :
ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
The code behind is working if I just put alert("Hello") inside function openModal().
But to open a materialize modal it is not working
A selector of an initialized modal is required and the DOM should be ready.
Did you already try Materialize 0.99.0?
Let me try with 0.99.0
It worked man it worked.
Great man.... 馃憤 馃憤
Thanks a lot...
Great to hear that.
You are welcome.
Most helpful comment
Please do not mix Bootstrap with Materialize, they collide, cause a black hole and destroy the whole humanity.
Are there any errors in your (browser) console and was the component initialized before calling the open method? Which version of Materialize do you use?