还是那个xml文件 ,最终显示效果是这样的
http://dev3.dev.pmcc.cn/11.aspxxml文件内容
<?xml version="1.0" encoding="gb2312" ?>
<pur>
<purd purtitle="权限设定">
<pursub ptitle="检索权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="修改权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="删除权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="帐号添加权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
</purd>
<purd purtitle="权限设定1">
<pursub ptitle="检索权">
<value vtitle="允许">12</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="修改权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="删除权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
<pursub ptitle="帐号添加权">
<value vtitle="允许">1</value>
<value vtitle="不允许">0</value>
</pursub>
</purd>
</pur>
子结点 1、0的值就是控件RadioButtonList的值
RadioButtonList默认值,都设为1吧
点击确定,能把RadioButtonList的值取出来。

解决方案 »

  1.   

    根据那个xml文件的内容,显示一个页面,显示的内容同这个页面
    http://dev3.dev.pmcc.cn/11.aspx
      

  2.   

    用XML样式啊。XSL格式化输出。自己看看书吧,没空帮你写。
      

  3.   

    //帮你写好了,晕阿XmlDocument xmlDoc=new XmlDocument();
    xmlDoc.Load(Server.MapPath("test.xml"));
    XmlElement root = (XmlElement)xmlDoc.SelectSingleNode("/pur");
    Table1.BorderStyle = BorderStyle.Groove;
    Table1.GridLines = GridLines.Both;
    foreach(XmlElement x1 in root.ChildNodes)
    {
    int i = Table1.Rows.Add(new TableRow());
    int j = Table1.Rows[i].Cells.Add(new TableCell());
    Table1.Rows[i].Cells[j].ColumnSpan = 2;
    Table1.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Center;
    Table1.Rows[i].Cells[j].Text = x1.GetAttribute("purtitle");
    foreach(XmlElement x2 in x1.ChildNodes)
    {
    i = Table1.Rows.Add(new TableRow());
    j = Table1.Rows[i].Cells.Add(new TableCell());
    Table1.Rows[i].Cells[j].Text = x2.GetAttribute("ptitle");
    j = Table1.Rows[i].Cells.Add(new TableCell());
    RadioButtonList list = new RadioButtonList();
    list.RepeatDirection = RepeatDirection.Horizontal;
    foreach(XmlElement x3 in x2.ChildNodes)
    {
    list.Items.Add(new ListItem(x3.GetAttribute("vtitle"), x3.InnerText));
    }
    Table1.Rows[i].Cells[j].Controls.Add(list);
    }
    }
      

  4.   

    Table1  怎么声明啊?
      

  5.   


    想知道,如果页面上进行了修改,然后,保存数据,怎么将其保存到XML文件中去呢?
      

  6.   

    每个RadioButtonList的值怎么获取啊?
      

  7.   

    点击确定按钮,怎么样获取RadioButtonList的值啊?
      

  8.   

    RadioButtonList list = new RadioButtonList();后面,给每个RadioButtonList一个ID
    list.ID = "radio_"+ i;另外在第二层加个计数器,告诉客户端,有几个radiobuttonlist.两种方法获取radio值:
    1. Request.Form方法
    2. Table1.FindControl, 然后ctl.SelectedValue....
      

  9.   

    刚学Xsl,试写了一下.没有完全实现功能.不知道怎样用id()函数,还有怎样得到所选radio.?
    高手继续.<?xml version="1.0" encoding="gb2312"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <table border="1">
    <xsl:for-each select="/pur/purd">
    <tr>
    <td  colspan="3" align="center"><xsl:value-of select="@purtitle"></xsl:value-of></td>
    </tr>
    <xsl:apply-templates select="pursub"></xsl:apply-templates>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    <xsl:template match="pursub">
    <tr>
    <td><xsl:value-of select="@ptitle"></xsl:value-of></td>
    <xsl:apply-templates select="value"></xsl:apply-templates>
    </tr>
    </xsl:template><xsl:template match="value">
    <td><input type="radio" name="radio"></input><xsl:value-of select="@vtitle"></xsl:value-of></td>
    </xsl:template></xsl:stylesheet>
      

  10.   

    我在click事件里获取 RadioButtonList 的值
    for(int i=1; i<=count;i++)
    {

    RadioButtonList radio=(RadioButtonList)Table1.FindControl("radio_"+i.ToString()); Response.Write(radio.SelectedValue);
    }"radio_"+i.ToString()换成 radio_1、radio_2....都不会出错
    为什么使用"radio_"+i.ToString() 不能获取啊
      

  11.   

    我明白了,没有产生radio_5所以为会出错