dropdownlist在前台用了这个方法,在后台改变selectIndex不触发前台事件,怎么办?

nierenyi nierenyi 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
onChange="Show(this.value)" <asp:DropDownList ID="ddlType" onChange="Show(this.value)" runat="server" CssClass="txt"
AutoPostBack="false">
<asp:ListItem Value="1">大专</asp:ListItem>
<asp:ListItem Value="2">本科</asp:ListItem>
<asp:ListItem Value="3">博士</asp:ListItem>
</asp:DropDownList>

function Show(value) {
alert(value);

if (value == "1") {
document.getElementById("1").style.display = "block";
document.getElementById("2").style.display = "none";
document.getElementById("3").style.display = "none";
}
if (value == "2") {
document.getElementById("1").style.display = "none";
document.getElementById("2").style.display = "block";
document.getElementById("3").style.display = "none";
}
if (value == "3") {
document.getElementById("1").style.display = "none";
document.getElementById("2").style.display = "none";
document.getElementById("3").style.display = "block";
}
}

后台

if(!ispostback) ddlType.SelectedIndex =Object.value; 分不多了,麻烦大家帮我看看,谢谢
...全文
评论 12
收藏 已收藏
分享
返回顶部
nierenyi
.NET社区 62,272 成员 668,968 内容