views:

20

answers:

2

I've this script inside my classic asp.

<script type="text/javascript">
var $dialog = $('<div></div>');
$dialog.load('cad_usr_pto_padrao_livres.asp?cd_usuario=' + <%= "'" & v_cd_usuario_cl & "'" %>);
$dialog.dialog({ title: 'Cadastro de Ponto Padrão', height: 300, width: 400,
                 closeOnEscape: true, hide: 'slide', position: 'center'  });
</script>

The behavior is basically create a modal the show the contents of cad_usr_pto_padrao_livres.asp. At first time, everything works fine, but after a second usage of this modal, the page don't reload. I've tried press ctrl+F5 to clean cache but nothing happens, but if I close and reopen the browser (Ie8) the page shows another (updated) fields.

*This page (cad_usr_pto_padrao_livres.asp), basically verify the standard equipment for each user and allow this change. So I can change but, I don't know how refresh the page.

A: 

Have you tried it with the JS inside a document.ready?

$(document).read(function(){

    var $dialog = $('<div></div>'); 
    $dialog.load('cad_usr_pto_padrao_livres.asp?cd_usuario=' + <%= "'" & v_cd_usuario_cl & "'" %>); 
    $dialog.dialog({ title: 'Cadastro de Ponto Padrão', height: 300, width: 400, 
                     closeOnEscape: true, hide: 'slide', position: 'center'  }); 


});
quakkels
I got the same behavior :/
Luís Custódio
A: 

The unique solution that I thought in this weekend was bring the contents of the div to the same page. So instead of load another page I just show the pop up.

My final code is something like (asp + js + html):

Response.Write "<div id=""modal"">"
'My asp contents and databse queries
Response.Write "</div>"

%>
<script type="text/javascript">
  $("#modal").dialog({ autoOpen: false, title: 'Defini&ccedil;&atilde;o de Ponto Padrão', height: 350, width: 400,
                       closeOnEscape: true, hide: 'slide', position: 'center' });
  $("#modal").dialog('open');
</script>
<% 
Luís Custódio