我在想把b.aspx的内容通过POST方法传到a.aspx中间去.
           首先我想获取form对象.然后修改他的action属性/.我想请问如何用js获取form对象,以及修改他的action属性.
             
forM对象的ID是form1!b.aspx和a.aspx是不同的2个工程里面的页面!

解决方案 »

  1.   

    两个工程里面的进行数据提交,还用script进行获取,那你直接用ajax不久得了,省的走那么多弯路啊
      

  2.   

     string html = string.Empty;        html += ("<html><head>");
            html += (string.Format("</head><body onload=\"document.{0}.submit()\">", FormName));
            html += (string.Format("<form name=\"{0}\" method=\"{1}\" action=\"{2}\" >", FormName, Method, Url));
            try
            {
                for (int i = 0; i < Inputs.Keys.Count; i++)
                {
                    html += (string.Format("<input name=\"{0}\" type=\"hidden\" value=\"{1}\">", Inputs.Keys[i], Inputs[Inputs.Keys[i]]));
                }
                html += ("</form>");
                html += ("</body></html>");            System.Web.HttpContext.Current.Response.Write(html);