<asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="300px" 
                    RepeatDirection="Horizontal" CellPadding="0" CellSpacing="0">
                <asp:ListItem   text= "Three "   value= "3 "> 
                    <img   src= "hp.jpg "> </asp:ListItem> 
                <asp:ListItem   text= "Two "   value= "2 "> 
                    <img   src= "zp.jpg "> </asp:ListItem> 
                <asp:ListItem   text= "One "   value= "1 "> 
                    <img   src= "cp.jpg"> </asp:ListItem>                 </asp:RadioButtonList>因为图片上有问题,所以不需要设置问题在项中。
问:我如何取得,每项中设置的text或value的值?

解决方案 »

  1.   

    DropDownList.DataTextField = ""; //DropDownList显示的内容
    ropDownList.DataValueField = "";//DropDownList的value值
      

  2.   

    var value = RadioButtonList1.SelectedValue; ?
      

  3.   


    你不是要获取吗   string a=DropDownList.DataTextField ;  
    你不会变通还有你到底是问DropDownList  还是RadioButtonList 
      

  4.   

     foreach (ListItem item in this.RadioButtonList1.Items)
            {
                this.Literal1.Text += item.Text + "***" + item.Value + "<br/>";
            }我用个Literal显示
      

  5.   

    你的意思是取得每一项的?
    foreach(ListItem item in RadioButtonList1.Items)
        //item.Text + item.Value;
      

  6.   

    string value = RadioButtonList1.SelectedValue;
      

  7.   

    value是显示值。我的显示的值只是一张图片,无法取到!null