用javascript改变了dropdownlist控件的值:
var option = document.createElement('option');
option.text =str;option.value =str;
list.add(option);
list.selectedIndex=list.options.length-1;然后按下按钮btn1,但在Btn1_Click事件中,发现dropdownlist.SelectedItem.Value的值仍然是旧值。
如何取得改变后的新值?

解决方案 »

  1.   

    用Request获取?如何获取啊?请教
      

  2.   

    post:Request.Form["name"]
    get:Request.QueryString["name"]
      

  3.   

    string myValue=this.Request["你的dropdownlist控件id"];
      

  4.   

    好像是不能的.楼主可以直接在.cs/.vb里写的.
      

  5.   

    试过了,cncxz(虫虫)的方法是可行的
    还有其他方法吗?下班前结账
      

  6.   

    不过可以通过Request.Form["控件id"]取得选中项的值
      

  7.   

    再请教:this.Request["你的dropdownlist控件id"]与this.Request.Form["控件id"]有用法区别吗?试下来好像都可以
      

  8.   

    当然有数区别,当控件在form 中有没有区别了
      

  9.   

    function add()
    {
        var backvalue="";
        var a1=null;
        var a2=null;
        if(document.Form1.pichidden.value=="")
        {  alert("请选取广告位要显示的默认图片!"); }
        else
        {
    for (i=0;i<document.all.Right.options.length;i++)

       a1=document.all.Right.options(i).value;
       a2=a1.split("*")[0];
       backvalue+=a2+',';
    }
    document.getElementById('TextBox3').value=backvalue;
    document.getElementById('TextBox4').value=document.Form1.pichidden.value;
    document.getElementById('LinkButton1').click();
        }
    }这样就可以了 注意 with =0px visible=true
      

  10.   

    再请教:this.Request["你的dropdownlist控件id"]与this.Request.Form["控件id"]有用法区别吗?试下来好像都可以
    -======================
    this.Request[]是模糊检索,他先检索get中的值,再检索post中的值..
    最好使用Request.Form[]。。效率比Request[]高