如果 asp.net DropDownList 设置为 EnableViewState=false,则 DropDownList.SelectedItem 返回 null。
那么在保持 EnableViewState=false 的同时,我可以使用什么技术来获取该 DropDownList 的 SelectedItem?
最佳答案
Request.Form[yourDropDownList.UniqueID]
UniqueID 返回“ctl00$ContentMain$ddlCountry”,其中
ClientID 返回“ctl00_ContentMain_ddlCountry”
UniqueID 被插入到用于回发表单名称的 HTML 表单的名称中。
关于asp.net - asp.net DropDownList 的“EnableViewState = false”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1318883/