那你总得给出textbox1 和 textbox2里的内容吧,不然怎么知道要生成什么样的xml

解决方案 »

  1.   

    关键是页面值传递问题吧?
    如果后台的话可以将前一个页面的值放进Session,在后一页面中取出来。如果TextBox仅仅是前台的值,不需要后台处理的话,可以采用Javascript来做。
    前台间传递数据,
    ---------------------------------------------------------------------
    father.html:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
    <head>
    <title>Untitled</title>
    <script>
    //argObj.str="Hell World";
    function child(){
    var argObj=new Object();
    argObj.str=fatherInput.value;
    window.showModalDialog("child.html", argObj);
    }
    </script>
    </head><body><input type="text" id="fatherInput"></input>
    <button onClick="child();">post</button></body>
    </html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    ---------------------------------------------------------------
    child.html
    <html>
    <head>
    <title>Untitled</title>
    <script>
    function getArg(){
    var oMyObject = window.dialogArguments;
    var str=oMyObject.str;
    childInput.value=str;
    }
    function  window.onload()
    {
    var oMyObject = window.dialogArguments;
    var str=oMyObject.str;
    childInput.value=str;
    }
    </script>
    </head><body><input type="text" id="childInput"></input>
    <button onClick="getArg();">getArg</button></body>
    </html>
    ---------------------------------------------
    俩页面间可以传递参数。当然构造XML文件可能需要后台来做。
    .net 的System.Xml空间有创建Xml文件的控件。
    或者用DataSet,
    最方便的是用Linq。