asp.net - Master page and JavaScript problem -
i prepared aspx file can open new window (window.open) command. in child window, values send parent page (.innerhtml) command , can close . however, after set master page parent page , command can not send value new window parent , can not close itself.
how master page can affect javascript commands?
thanks
edit: drachenstern (i can have ... pasted)
from child code behind:
<br> page.registerstartupscript("close", "<...js...><script type=\"text/javascript\">" +<br> "window.opener.document.getelementbyid('tableid').innerhtml = \"" + radionumber + "\";" +<br> "window.opener.document.getelementbyid('hiddentableid').value = \"" + radionumber + "\"; <br> self.close();" + "<...js....></script>" );<br>
parent side:
<br> ..a ..<br>href="javascript:window.open('selecttable.aspx','open','toolbar=no,directories=no,status=no,titlebar=no,menubar=no,scrollbars=no,resizable=no,width=800,height=600,top=0,left=0,');"/>selectsomthng<br>../a..
second edit: (again drachenstern) it appear intention
from child code behind:
page.registerstartupscript("close", "<...js...><script type=\"text/javascript\">" + "window.opener.document.getelementbyid('tableid').innerhtml = \"" + radionumber + "\";" + "window.opener.document.getelementbyid('hiddentableid').value = \"" + radionumber + "\"; + self.close();" + "<...js....></script>");
parent side:
/* drachenstern: notice put carriage returns legibility, not in original code*/ <a href="javascript:window.open( 'selecttable.aspx', 'open', 'toolbar=no,directories=no,status=no,titlebar=no,menubar=no, scrollbars=no,resizable=no,width=800,height=600,top=0,left=0,' );"/>selectsomthng</a>
if want control of parent page in child window , using master page parent page... can use following control of input type or other type using tagname
var collection=window.opener.document.body.getelementsbytagname('input') alert(collection[o].id); alert(collection[1].id); alert(collection[2].id);..... ext
you can traverse through collection , find id want indexof()
method , perform whatever things want.
Comments
Post a Comment