ASP.NET Javascript: window.open won't work twice -
i have aspx page button. when user clicks button, following javascript opens new browser window (in case, 'reasons.aspx'). works great. here's function part:
function showpanel(url) { var width = 750; var height = 600; var left = (screen.width - width) / 2; var top = (screen.height - height) / 2; var params = 'width=' + width + ', height=' + height; params += ', top=' + top + ', left=' + left; params += ', toolbar=no'; params += ', menubar=no'; params += ', resizable=yes'; params += ', directories=no'; params += ', scrollbars=no'; params += ', status=no'; params += ', location=no'; newwin = window.open(url + '?letternumber=1&reasontype=3', 'd', params); //<--- change (letternumber) when copying! if (window.focus) { newwin.focus() } return false; }
now here's gets funky. when window pops up, there controls. 1 of button, triggers identical code popup third window (in case, reasoncodes.aspx). won't work. here's code that:
function fgetreasons(url) { var width = 750; var height = 600; var left = (screen.width - width) / 2; var top = (screen.height - height) / 2; var params = 'width=' + width + ', height=' + height; params += ', top=' + top + ', left=' + left; params += ', toolbar=no'; params += ', menubar=no'; params += ', resizable=yes'; params += ', directories=no'; params += ', scrollbars=no'; params += ', status=no'; params += ', location=no'; newwin = window.open(url, 'd', params); //<--- change (letternumber) when copying! if (window.focus) { newwin.focus() } return false; }
i've set breakpoints on javascript. execute. here's what's weird -- above javascript executes, don't new window reasoncodes.aspx. however, set breakpoint in page_load of reasoncodes.aspx , of executes. javascript executes, code-behind page_load of third page executes, don't third page.
instead, second window (reasons.aspx) refreshes. it's third window somehow 'hidden'.
can tell me what's going on, or missing?
thanks,
jason
ps -- know 3 windows sounds lot, , it's not choice. there's business need here (this local intranet application) , have abide specs. thanks.
the 2nd parameter window.open
name of window. using same name in both calls attempting use same window. change name of 2nd call , should fine.
Comments
Post a Comment