javascript - Pop up window opened from code behind is not getting closed -


i opening pop code behind(which using waiting image while processing) after doing activity in background ,when activity done closing pop . problem after activity on pop not getting closed. doing wrong, here code snippet:-

    system.text.stringbuilder sb = new system.text.stringbuilder();             sb.append("<script language='javascript'>");             sb.append("var win=");             sb.append("window.open('waitingimage.aspx', 'wait',");             sb.append("'width=800, height=600, menubar=no, resizable=no');window.focus();<");             sb.append("/script>");              type t = this.gettype();             if (!clientscript.isclientscriptblockregistered(t, "popupscript"))             {             clientscript.registerclientscriptblock(t,"popupscript", sb.tostring());             }         //pop opened.. processing :-              uploadfiles();         //now close pop after work done:-          system.text.stringbuilder sbs = new system.text.stringbuilder();         sbs.append("<script language='javascript'>");         sbs.append("window.close()");         sbs.append("/script>");         type tr = this.gettype();         clientscript.registerclientscriptblock(tr, "popupscript", sbs.tostring()); 

you assign popup win variable, when closee call window.close...

try change

 sbs.append("window.close()"); 

to

 sbs.append("win.close()"); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -