ASP.NET is still HTML after all,right? your javascript method is still valid

解决方案 »

  1.   

    事实上如果要使用的话依然需要js来完成,但是可以把所有代码放在.cs中,参考:
    http://www.csdn.net/expert/topic/870/870084.xml?temp=.7015497
      

  2.   

    比如说,我在做项目管理时候,我要求在TEXTBOX输入公司名,所以我在旁边放了个BUTTON,点击按钮的时候跳出另外页面,调用公司列表,当选择公司名是自动填入主页面的TEXTBOX中。我听说opener.window.document是基于浏览器的,对服务器端控件不起作用。不知道是否这样。
      

  3.   

    of course, opener.window.document is on the client side, you need to put those values into those controls, then the server side can get them
      

  4.   

    thank you everyone.
    我通过传输数据的方式可以让父窗体获得子窗体的值,但每次肯定要刷新。用
    opener.window.document 却可以在不刷新窗体的情况下传输字符串。你们可以给我段代码吗?
    to saucer:
    how to get the attribute of another document such as javascript have done.
    to  mmkk():
    用document.getElementById(form)是可以获得本窗口FORM的ID,但要获取别的页面FORM的ID要如何写?
      

  5.   

    当你选择子窗口中的公司名后你可以通过触发事件(可能onchange或者onclick等)调用某个方法来传递回opener.
    such as:
    opener.document.getElementById("Control_ID").value = something;
    Control_ID你可以在父窗口点击你所说的button的时候传递到子窗口,子窗口很容易就可以获得这个参数,这样保证传递回去是正确的.