JavaScript ShowModalDialog + Aspx page_load event not fires

I was using following code to show  Popup window

//opens a pop up window
function PopupWindow(url) {
mywindow =window.open( url, “Popupwindow”,
“location=1,status=0,scrollbars=1,width=800,
height=600,resizable=1,toolbar=0″ )

Above code was showing Popwindow then Requirement changed and we needed a Modal popup Window.  Then I found followin code which provides required functionality.

//opens a pop up window
function PopupWindow(url) {
var ie=document.all;
if (ie)
window.showModalDialog(url,”Window”,”status:no; help:no;
dialogWidth:1200px; dialogHeight:768px”);
else
{
var mywindow =window.open( url, “Popupwindow”,
“location=1,status=no,scrollbars=1,width=1200px,
height=768px,resizable=1,toolbar=0″ )
mywindow.focus();
}


I was using above code to show Audit and History of data for a specified field. This was not working 100% as When we open page in ModalWindow using ShowModalDialog it Caches all data. So the Page_Load Event of my .aspx page was not firing after 1st click for that specific field . As Page_Load event was not firing, I was unable to get the latest changes made by the user.  To See the latest changes made by user we were closing the browser and doing the whole process again i.e. open browser , login , search that record and see the history which was a pain.

To stop the page caching I am now using the page directiv

<%@ OutputCache Location=”None” %>

Above directive is not allowing page to cache anything so my problem is solved.

I can show the latest changes made by the user now. :)

Free books on almost every topic

http://knowfree.net/

You can find free books here on almost every topic.
ajax, php, java, c#, asp, networking training, cisco network, photoshop, graphics, desing, web construction, business ebooks,
SAP, oracle, mysql, mssql, .net, dot net, j2ee, j2me, linux, unix, windows, windows vista, office, database, programming, software development, video training, dreamweaver,
flash, flash training, css, action script, ruby, ruby on rails, python

|