日期:2014-05-17  浏览次数:20469 次

RadioButtonList在DataList或者GridView里什么取值
本人自学所以基础很差- -~~

------解决方案--------------------
页面应该看得懂吧,后台注释如下:
protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //初始化一个Datatable
                DataTable dt = new DataTable();
                dt.Columns.AddRange(new DataColumn[] { 
                    new DataColumn("name",typeof(string)),
                    new DataColumn("age",typeof(string))
                });

                DataRow dr = null;

                dr = dt.NewRow();
                dr["name"] = "guwei";
                dr["age"] = "30";
                dt.Rows.Add(dr);

                dr = dt.NewRow();
                dr["name"] = "google";
                dr["age"] = "28";
                dt.Rows.Add(dr);

                //DataList绑定这个Datatable