有没有动态表单的开源资料啊,我需要自己设计表单,然后生成web表单。
在C/S下设计表单倒是很容易,用线代替Table的边线就可以了,现在问题是如何把在C/S下面的设计的表单转换为Web表单,这个是比较麻烦的事情。设计表单用Dreamewave设计倒是很容易,但是我需要自行定义一系列的绑定信息,所以想自行设计表单。如何来处理阿?
各位给提示一下思路。

解决方案 »

  1.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    if(!IsPostBack)
    {
    XmlDocument xdoc=new XmlDocument();
    xdoc.Load(Server.MapPath(@"\publicxml\dweb.xml"));
    Response.Write("<table border=0 width=400 height=41>");
    foreach(XmlNode xubnd in xdoc.SelectSingleNode("//root").ChildNodes)
    {
    k=false;
    XmlElement xel=(XmlElement)xubnd; 
    Response.Write("<tr bgcolor=#66FF99>");
    Response.Write("<td colspan=4 width=400>"+ xel.GetAttribute("name").ToString() +"</td>");
    Response.Write("</tr>");
    foreach(XmlNode subnd in xubnd.ChildNodes)
    {
    k=false;
    XmlElement subel=(XmlElement)subnd;
    Response.Write("<tr>");
    Response.Write("<td rowspan=3 width=10></td>");
    Response.Write("<td colspan=3>"+subel.GetAttribute("name").ToString()+"</td>");
    Response.Write("</tr>");
    foreach(XmlNode d in subnd.ChildNodes)
    {
    XmlElement el_img=(XmlElement) d;

    if (el_img.Name=="picture")
    {
    Response.Write("<tr>");
    string aa=el_img.InnerText;
    Response.Write("<td width=50 rowspan=2 ><img border=0 src="+el_img.InnerText +"></img></td>");
    }
    else
    {
    if(subnd.ChildNodes.Count>2)
    {
    foreach(XmlNode t in d.ChildNodes)
    {
    XmlElement el=(XmlElement)t;
    if(k)
    {
    if(el.Name=="text")
    {
    Response.Write("<tr><td colspan=2></td>");
    Response.Write("<td width=5>&gt;&gt;</td>");
    Response.Write("<td width=340><a href=' '>"+el.InnerText+"</a></td>");
    Response.Write("</tr>");
    Response.Write("</tr>");
    }
    else
    {
    Response.Write("<tr><td colspan=3></td>");
    Response.Write("<td width=330>"+el.InnerText +"</td>");
    Response.Write("</tr>");
    }
    }
    else
    {
    if(el.Name=="text")
    {
    Response.Write("<td width=5>&gt;&gt;</td>");
    Response.Write("<td width=340><a href=' '>"+el.InnerText+"</a></td>");
    Response.Write("</tr>");
    }
    else
    {
    Response.Write("<tr>");
    Response.Write("<td></td>");
    Response.Write("<td width=340>"+el.InnerText +"</td>");
    Response.Write("</tr>");
    k=true;
    }
    } }
    }
    else
    {
    foreach(XmlNode t in d.ChildNodes)
    {
    XmlElement el=(XmlElement)t;
    string b=el.InnerText;
    if(el.Name=="text")
    {
    Response.Write("<td>&gt;&gt;</td>");
    Response.Write("<td width=3430><a href=' '>"+b+"</a></td>");
    Response.Write("</tr>");
    }
    else
    {
    Response.Write("<tr>");
    Response.Write("<td></td>");
    Response.Write("<td width=340>"+b +"</td>");
    Response.Write("</tr>");
    }
    }
    }
    }
    }
    }
    }
    Response.Write("</table>");
    }
    }