可以的,你用request.Form("listname")来取

解决方案 »

  1.   

    解决方法其实你可以很好的找到 原因也可以找到的 你自己跟一下的你的程序 看看值是在哪丢的 在哪得到的 你最好把代码贴出来给大家看看 你这样说也不好说你的问题出在哪里。
    孟子老兄的观点我不是很赞同的。前端脚本修改客户端控件的value这样做没什么不好,起码不用刷新界面。只要方法正确
      

  2.   

    <%@ Page Language="C#" AutoEventWireup="True" %>
    <html>
    <head>
       <script runat="server">
          void Button_Click(Object sender, EventArgs e) 
          {
             Label1.Text = "You selected: " + 
             Request.Form["dropdownlist1"].ToString() + ".";  
          }
       </script>
    </head>
    <body>
       <form runat="server">    
          <asp:ListBox id="dropdownlist1" runat="server">
             <asp:ListItem>Item 1</asp:ListItem>
             <asp:ListItem>Item 2</asp:ListItem>
             <asp:ListItem>Item 3</asp:ListItem>
             <asp:ListItem>Item 4</asp:ListItem>
          </asp:ListBox>
          <br><br>
          <asp:Button id="Button1"  
               Text="Submit" 
               OnClick="Button_Click" 
               runat="server"/>
          <br><br>
          <asp:Label id="Label1" runat="server"/>
          <input id=x> <input type=button onclick="add()" value="添加">
       </form>
    </body>
    </html>
    <script>
    function add()
    {
    //alert(document.getElementById("dropdownlist1").options[2].value)
    document.getElementById("dropdownlist1").options[document.getElementById("dropdownlist1").options.length] = new Option(document.all.x.value,document.all.x.value,true,true)
    }
    </script>
      

  3.   

    澄清:
    1/A窗体中用的是listbox,而且要取其中的每个值,用request怎么取
    2/我调试过,在窗体load的时候listbox里已经没有值了
      

  4.   

    谢谢各位,但是我试了,request.form的方法虽然可以取到值,但是取的仅仅是listbox中选中项的值,而且提交后listbox就空了
      

  5.   

    request.form的方法虽然可以取到值,但是取的仅仅是listbox中选中项的值,而且提交后listbox就空了
      

  6.   

    listbox的autopostback属性设置为true
      

  7.   

    这个是很正常的,在.net的web中很容易发生这样的事情,就是用javascript程序添加的值不能被正确提交,主要是需要一致性的处理,但是只要你用鼠标或者键盘操作了这个控件结果就会出来了