c# - Calling JavaScript Function From CodeBehind doesn't work with FileUpload -


i'm creating following functionality: create table on button click using data excel file loaded , save table xml file. after saving want show modal window (bootstrap) message. window managed javascript function , called function code behind.

this html page:

<head>   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>   <script src="../js/bootstrap.js" type="text/javascript"></script> </head> <body>   <form id="form1" runat="server">      <div id="modalsaved" class="modal hide fade">         <div class="modal-header">             <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>         </div>         <div class="modal-body">             <p>                 changes saved successfully!             </p>         </div>         <div class="modal-footer">             <button type="button" runat="server" id="ok" class="btn btn-default" data-dismiss="modal">ok</button>         </div>     </div>      <asp:scriptmanager id="scriptmanager" runat="server"></asp:scriptmanager>     <div id="file">                      <asp:fileupload runat="server" id="openfile" accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />     </div>      <div id="actions" runat="server">       <asp:button id="createrepbtn" runat="server" onclick="createrepbtn_click" />       <asp:button id="savetoxml" runat="server" onclick="savetoxml_click" />     </div>      <script type="text/javascript">        function openmodalsaved() {            $('#modalsaved').modal('show');        }     </script>    </form> </body> 

and c# code calling javascript function:

protected void savetoxml_click(object sender, eventargs e) {    /* save xml code */       scriptmanager.registerstartupscript(this, this.gettype(), "pop", "openmodalsaved();", true); } 

the problem modal window doesn't appear. supporse connected fileupload element somehow because on page without fileupload such code works perfect.

i've tried use updatepanel (fileupload element outside) doesn't help.

does know how solve problem? suggetions welcome.

    protected void savetoxml_click(object sender, eventargs e) {      scriptmanager.registerstartupscript(this, this.gettype(), "pop", "$(function(){openmodalsaved();});", true); } 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -