zoukankan
html css js c++ java
asp.net服务器控件调用js
<
asp:DropDownList id
=
"
DropDownList1
"
runat
=
"
server
"
>
<
asp:ListItem Value
=
"
1
"
>
11111
</
asp:ListItem
>
<
asp:ListItem Value
=
"
2
"
>
222222
</
asp:ListItem
>
</
asp:DropDownList
>
<
div id
=
"
div1
"
>
11111
</
div
>
<
div id
=
"
div2
"
>
22222
</
div
>
function change()
{
//
下面这句使用Form1.DropDownList1.value无法得到value,要用getElementById
if
(document.getElementById (
'
DropDownList1
'
).value
==
"
1
"
)
{
div2.style.display
=
"
none
"
;
div1.style.display
=
"
block
"
;
}
else
{
div2.style.display
=
"
block
"
;
div1.style.display
=
"
none
"
;
}
}
//
下面是重点,为DropDownList1控件的onChange事件绑定js的change()函数
private
void
Page_Load(
object
sender, System.EventArgs e)
{
DropDownList1.Attributes.Add(
"
onChange
"
,
"
change();
"
);
}
查看全文
相关阅读:
发送带SMTP身份认证的电子邮件
将class文件打包成可执行文件
迈入本本一族
关于Java的一些 工具,类库,框架......
Java中用Servlet容器实现程序监听
用JDOM读写XML
Firefox丰富多彩的插件
DIV居中——不大不小的问题
羽绒外套
pku1469 COURSES
原文地址:https://www.cnblogs.com/nasdaqhe/p/542053.html
最新文章
IIS express 配置和500.22错误解决详解
DNN6.0.1 module支持AJAX的操作方法
Silverlight 动画 之 平移
Silverlight中打开文件和保存文件
Silverlight中将字符串转换成Color类型
什么叫架构师?一起来认识下吧
手机号码格式等判断
摇一摇截图反馈
使用SourceTree的注意事项
常用的Linux命令
热门文章
属性限定符号
自定义Model类
查看整个项目的代码行数
App在iTunes Store上的地址
PowerHandle管理页面
isEqual判断相等性
iOS10打电话、发短信、发邮件等小功能
实现导航栏渐变显示
python数据库学习Mysql
数码伴侣
Copyright © 2011-2022 走看看