<asp:DropDownList ID="DropDownList3" runat="server">
                
                    <asp:ListItem Text="不缺" Value=">="></asp:ListItem>
                </asp:DropDownList>
上面红色部分是错误的,但是我要怎么写才能在服务器端取到DropDownList3.value的值为“>=”呢?

解决方案 »

  1.   

     <asp:ListItem Text="不缺" Value=\">=\"></asp:ListItem>注意转义
      

  2.   

    <asp:DropDownList ID="DropDownList3" runat="server">
        
      <asp:ListItem Text="不缺" Value="&gt;="></asp:ListItem>
      </asp:DropDownList>
      

  3.   

    > 用 &gt;
    < 用 &lt;
      

  4.   

    <asp:DropDownList ID="DropDownList3" runat="server">
        
      <asp:ListItem Text="不缺" Value="&gt;="></asp:ListItem>
      </asp:DropDownList><asp:ListItem Text="不缺" Value=\">=\"></asp:ListItem>都行。 &gt;代表>
     &lt;代表<
      

  5.   

            <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem Text="不缺" Value=">="></asp:ListItem>
            </asp:DropDownList>    protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(DropDownList1.SelectedValue + " " + DropDownList1.Items[DropDownList1.SelectedIndex].Text);
        }
    /*
    >= 不缺
    */
      

  6.   


    汗... <asp:ListItem Text="不缺" Value=">="></asp:ListItem>这句编译就会不通过..
      

  7.   

    <asp:DropDownList ID="DropDownList3" runat="server">
        
      <asp:ListItem Text="不缺" Value="&gt;="></asp:ListItem>
      </asp:DropDownList>