用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的值仍然是旧值。  
  如何取得改变后的新值?  

 

用这个 this.Request["你的dropdownlist控件id"]与this.Request.Form["控件id"],就可以在C#后台的代码中取得你选择的值,而用droplist.items[i]是取不到值的。这个问题困扰了我两三天。和大家分享,以免继续这样的错误。

 

  this.Request[]是模糊检索,他先检索get中的值,再检索post中的值..  
  最好使用Request.Form[]。。效率比Request[]高  

http://topic.csdn.net/t/20050627/09/4106767.html

相关文章:

  • 2021-11-09
  • 2022-12-23
  • 2021-06-10
  • 2021-06-27
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2021-09-25
  • 2021-07-14
  • 2022-12-23
  • 2021-07-04
  • 2021-12-22
  • 2021-09-10
相关资源
相似解决方案