我每个页面字段名称,字段多少不同,但我想做一个通用的查询,
window.showModalDialog('search.aspx',window)弹出窗口,
search.aspx上根据传递的父窗口字段参数动态建立text,
这样怎么实现

解决方案 »

  1.   

    我想可以这样,你在调用showModalDialog时就要把参数传递过去,就是把子页面的地址写成search.aspx?参数1=值1&参数2=值2...。然后,你就可以在search.aspx的page_load事件中根据这些参数创建动态的文本框等。
      

  2.   

    呵呵,很好搞,做一个search.aspx然后在主窗口写上一个发送数据,在search.aspx 中写上一个接受数据,和楼上的差不多!呵呵,多试几便就好了!!!!!!
    -----------------------------------------------------------------------------------------
      我们努力,所以我们能成功,为每一个为明天而努力的人们喝彩,加油!!
      

  3.   

    用CreateElement或者CreateObject可以搞定,
    下面这个方法创建一个新的行到Table ItemsTable中
    function insertNewItem()
    {
    var row;
    var cell;
    var tbody = ITEMSTABLE.childNodes[0];
    ITEMSTABLE.appendChild( tbody );
    row = document.createElement( "TR" );
    tbody.appendChild( row );
    row.onclick=new Function("onSelectedRow(NEWLINE"+nMAX+")");
    //row.ondblclick=new Function("onSelectedRow(LINE_"+itemid+");updateQ();");
    //row.onClick=new Function("onSelectedRow(LINE_"+itemid+")");
    //row.id="LINE_"+itemid;
    row.SUBID=nMAX;
    row.id="NEWLINE"+nMAX;
    row.VOTEID="<%=request.getParameter("VOTEID")%>";
    cell = document.createElement( "TD" );
    row.appendChild(cell);
    var x=document.createElement("font");
    cell.appendChild(x);
    x.innerText="  ";
    var afo = document.createElement("input");
    cell.appendChild(afo);
    afo.type="text";
    afo.id="NEWSUB"+nMAX;
    afo.value="";
    afo.DEL=0;
    afo.size=55;
    afo.focus();
    nMAX++;
    }
    你可以参考一下