如何实现一个与http://www.lenosoft.net/depot/index.asp该网页中的分仓汇总中的货品类别相同效果

解决方案 »

  1.   

    你查看一下源代码就知道了。
    基本就是用window.open()弹页
    在弹出页里用window.opener来操作父页面的元素
      

  2.   

    <IMG style="CURSOR: hand" onclick='openwin("../public/mtreehp.asp?table=goodstype",340,300)' src="../images/f.gif">
      

  3.   

    我这里什么效果都没有。
    showmodaldialog
      

  4.   


    function openwin(URL,x,y){
    var URL;
    var x1=window.screen.width;   
    var y1=window.screen.height;   
    x2=(x1-x)/2;   
    y2=(y1-y)/2;
    window.open(URL,'','top='+y2+',left='+x2+',width='+x+',height='+y+',status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes')   
    }
      

  5.   

    父页面和子页面间刷新,关闭,操作,总结资料收集http://topic.csdn.net/u/20091112/09/342769c1-0abf-4f92-8699-7ac7d462e0cf.html
      

  6.   

    window.oepn+window.pener.document.getElementById
      

  7.   

    那点击TREEVIEW后直接把值传到父界面的TXT中 这么弄
      

  8.   

    你用的 TREEVIEW 控件?
      

  9.   


    参考:http://topic.csdn.net/u/20091029/15/b1e0e1b0-2d84-4a61-a207-a51eafb56ebd.html
      

  10.   

    window.opener.document.getElementById("xxx").innerHTML="xxxx";
      

  11.   

    http://www.lenosoft.net/depot/index.asp该网页中的分仓汇总中的货品类别相同效果  就跟这个选择货品类别的效果一样。在选择节点后能直接把值传过去,不过现在就是还要用一个按钮才能传值
      

  12.   

    看看通达OA系统,通过window.open打开页面
    window.opener.document.getElementById?("").value="";
    看看页面源码就明白了
      

  13.   

    谢谢 大家 , 在子窗体中点击 treeview,获得的节点名,如果在加一个按钮,我可以把节点名传回到父窗体。但我想可不可以不要按钮,在点击treeview的节点时,每次都会获得一个节点名,同时把这个节点名传回到父窗体,并显示到一个文本框中。如果可以话,请做个小程序发给我。[email protected]. 谢谢
      

  14.   

    window.open(...) 
    子页面中获取父页面对象:window.opener 
    window.showModalDialog(..) 
    子页面中获取父页面对象:window.dialogargument 
      

  15.   

      function select() {
               var url = "../a.aspx?ToId=PId&ToName=PName";
               var mwidth = "400";
               var mheight = "250";
               var loc_x, loc_y;
               if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
                   alert(mwidth); loc_x = parseInt((document.body.clientWidth - mwidth) / 2 + 200);
                   loc_y = parseInt((document.body.clientHeight - mheight) / 2);
                   window.open(url, "", "left=" + loc_x + "px,top=" + loc_y + "px,width=" + mwidth + "px,height=" + mheight + "px,resizable=no,scrollbars=yes,status=0");
               }
               else {
               
                   loc_x = document.body.scrollLeft + event.clientX - event.offsetX - 100;
                   loc_y = document.body.scrollTop + event.clientY - event.offsetY + 170;
                   window.open(url, "", "left=" + loc_x + "px,top=" + loc_y + "px,width=" + mwidth + "px,height=" + mheight + "px,resizable=no,scrollbars=yes,status=0");
                   //indow.showModalDialog(url, self, "edge:raised;scroll:1;status:0;help:0;resizable:0;dialogWidth:" + mwidth + "px;dialogHeight:" + mheight + "px;dialogTop:" + loc_y + "px;dialogLeft:" + loc_x + "px");
               }
           }
    a.aspx
     var p_window;
          if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
              p_window = window.parent.opener;
          else
              p_window = window.parent.opener; 

          function SetValue(id, name) {
              p_window.document.getElementById("hf_Id").value = id;
              p_window.document.getElementById("txtName").value =name;
              self.close();
          }
      

  16.   

    父窗体源码  定义了一个 TextBox3 和一个  ImageButton
    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    &nbsp; 
                    <asp:ImageButton ID="ImageButton1" runat="server" onclick="ImageButton1_Click" 
                        style="height: 16px; width: 14px" />ImageButton1_Click 事件中的代码
    Response.Write("<script>window.open('Default.aspx','','width=400,height=300')</script>");子窗体 Default.aspx 源码  定义了一个 TreeView1 TextBox1  button
    <asp:TreeView ID="TreeView1" runat="server" 
            
                onselectednodechanged="TreeView1_SelectedNodeChanged">
            </asp:TreeView>
        <p>
            &nbsp;</p>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <input type='button' value='执行' 
    onclick='window.opener.document.getElementById("TextBox3").value=document.getElementById("TextBox1").value;' /></form>TreeView1_SelectedNodeChanged 事件代码
    string strValue = this.TreeView1.SelectedNode.Text;
    TextBox1.Text = strValue;现在碰到的问题 如果在子窗体不需要BUTTON 在 TreeView1_SelectedNodeChanged 事件中 如何把TreeView1.SelectedNode值传到父窗体的TXTBOX3中
      

  17.   


    Page.ClientScript.RegisterStartupScript(GetType(), "set", "window.opener.document.getElementById('TextBox3').value=document.getElementById('"+TextBox1.ClientID+"').value;", true);
      

  18.   

    父窗体 一个按钮 和一个 GridView
    <asp:Button ID="PdBtn" runat="server" Text="添加货品" Width="65px" 
                            onclick="PdBtn_Click" />
    PdBtn_Click事件代码
    Response.Write("<script>window.open('Default2.aspx','','width=400,height=300')</script>");
    子窗体 一个gridbiew
    如何每次点击GRIDVIEW都会获得ID,把多次点击的ID 传回到父窗体。
    如何一次性多传递多个ID
      

  19.   

    你说的点击GRIDVIEW 是点击子窗体里的?如果是的话,你GRIDVIEW 每行中 有什么标示被点击 checkbox ? radio?
      

  20.   

    value='id1,id2,id3'这样传递就可以的
      

  21.   

    是在子窗体里的GRIDVIEW,应该每次点击GRIDVIEW 时 都会获取该行的一个materials_id,将多次点击后获取的所有ID 都返回到 父窗体这样是在GRIDVIEW 的事件里写 应该怎么弄? 具体语句该怎么写
      

  22.   

    你点击 GRIDVIEW  时 怎么获得的materials_id?
      

  23.   

    gridview1的绑定
    GridView3.DataKeyNames = new String[] { "mater_id" };
    GridView3.DataSource = myds;
            GridView3.DataBind();在gridview1上有一个选择按钮 
    在selectedindexchanging事件中加入一下代码  获得mater_id
    string mater_id=gridview1.datakeys[e.newselectedindex].value.tostring
    现在就是点击GRIDVIEW1中的选择按钮后,将该行的mater_id值传到母界面。要求一次性能传多行的mater_id值?
    在母界面又如何取出这些mater_id值?
      

  24.   

    你这样,在子页上 放一个HiddenField 在 gridview1 的 selectedindexchanging 事件中得到mater_id  后 赋值给 HiddenField   用+= 等形式 用,分隔这样 就会存住 多次的ID传值的时候 传 HiddenField   的值 就可以了这样就是多个ID 了,形式是 eg: id1,id2,id3
     
      

  25.   


    这句就是传值的语句啊只是 把TextBox1.ClientID 换成 HiddenField.ClientID 
      

  26.   

    这样是传过去了,不过这些ID 在父界面都要用SELECT重新查询 并显示到GRIDVIEW。请问有没什么方法可以把子页面传过去直接在GRIDBIEW显示