-3
I’m trying to run a modal through ASP.NET and I got it;
Using the Script
<div id="mymodals" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
<asp:Label Text="" ID="lbl_errortitulo" runat="server" /></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<asp:Label Text="" ID="lbl_errormsg" runat="server" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Entendi</button>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="btn btn-primary" id="btn_execute" onclick="Mensagem()" >Executar</p>
</div>
</div>
<script type="text/javascript">
function Mensagem() {
$('#mymodals').modal({ show: true });
}
</script>
However, if I put it on an Asp:Button I think Postback will make you "bugger off"...
The doubt is, needed to run this modal by code-Behind when it fell into the "catch", using;
ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(),
"mymodals",
"Mensagem();",
true
);
Only, it does not perform, I believe it is the postback!?
The data are fixed?
– novic
As so fixed?
– Junior Dias
Show Modal ??? and ???? because if it’s Javascript you don’t need to switch to Backend
– novic
So I wanted you to call Modal in case I fell in the Try block catch
– Junior Dias
There’s nothing in your question that shows
try
catch
!– novic
The doubt is, needed to run this modal by code-Behind when it fell into the "catch", using;
– Junior Dias
Your doubt is not clear, there is no catch, there is no code-Behind in the question, there is only one page code
aspx
(excerpt) and a function in javascript ... ie, rephrase your question– novic