c# - RegisterStartupScript only working part of the time -
i have method pulls html webservice , displays info in series of popup windows. achieve wrote javascript create popup:
function dynamicpopup(title, htmlstring) { newwindow = window.open(); newdocument = newwindow.document; newdocument.write(htmlstring); newdocument.title = title; };
the loop through results calling following every object returned webservice.
page.clientscript.registerstartupscript(this.gettype(), datetime.now.tostring(), resultmessage, true);
the problem works when few popups returned if 15 returned 8-10 of them displayed.
as bandage added wait after registerstartupscript , seems work results in slower delivery times. know other way address issue?
instead of calling multiple page.clientscript.registerstartupscript
in loop, first construct script needs run (e.g. using stringbuilder, combine multiple resultmessage
separated ';') , call page.clientscript.registerstartupscript
once execute resulting string.
Comments
Post a Comment