按钮-Button

按钮-Button

按钮添加JaveScript代码

1
按钮-Button
<
asp:Button 
ID
=”Button1″
 runat
=”server”
 Height
=”28px”
 Text
=”点我”
 Width
=”93px”


2
按钮-Buttononmouseover
=”c=this.style.backgroundColor; this.style.backgroundColor=’#00ff99′; this.style.width=’150′;”


3
按钮-Buttononmouseout
=”this.style.backgroundColor=c;this.style.width=’93’;”
 Font-Bold
=”true”
/>

按钮添加属性

按钮-Button
protected
 
void
 Button2_Load(
object
 sender, EventArgs e)
按钮-Button按钮-Button    

按钮-Button
{

按钮-Button        
按钮-Button        Button2.Attributes.Add(
onmouseoverc=this.style.backgroundColor;this.style.backgroundColor=’#00ff99′;);
按钮-Button        Button2.Attributes.Add(
onmouseoutthis.style.backgroundColor=c);
按钮-Button        Button2.Text 
= DateTime.Now.ToString();
按钮-Button    }

按钮CommandName属性
PS:
三个按钮同时触发button2_Click事件,根据事件惩罚者((Button)sender)的CommandName来判断

按钮-Button
<
asp:Button 
ID
=”Button2″
 runat
=”server”
 CommandName
=”a”
 OnClick
=”Button2_Click”
 Text
=”小明”
 OnLoad
=”Button2_Load”
 
/>

按钮-Button        

<
asp:Button 
ID
=”Button3″
 runat
=”server”
 CommandName
=”b”
 OnClick
=”Button2_Click”
 Text
=”小里”
 
/>
&nbsp;

按钮-Button        

<
asp:Button 
ID
=”Button4″
 runat
=”server”
 CommandName
=”c”
 OnClick
=”Button2_Click”
 Text
=”小王”
 
/>

按钮-Button
protected
 
void
 Button2_Click(
object
 sender, EventArgs e)
按钮-Button按钮-Button    

按钮-Button
{

按钮-Button        
switch (((Button)sender).CommandName)
按钮-Button按钮-Button        
按钮-Button{

按钮-Button            
case a:
按钮-Button                lb1.Text 
= ((Button)sender).Text;
按钮-Button                
break;
按钮-Button            
case b:
按钮-Button                lb1.Text 
= ((Button)sender).Text;
按钮-Button                
break;
按钮-Button            
default:
按钮-Button                lb1.Text 
= 33333;
按钮-Button                
break;
按钮-Button        }

按钮-Button
按钮-Button    }

转载于:https://www.cnblogs.com/net123/archive/2007/12/15/996215.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/111060.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Linux环境redis集群搭建「建议收藏」

    (要让集群正常工作至少需要3个主节点,在这里我们要创建6个redis节点,其中三个为主节点,三个为从节点,对应的redis节点的ip和端口对应关系如下)127.0.0.1:7000127.0.0.1:7001127.0.0.1:7002127.0.0.1:7003127.0.0.1:7004127.0.0.1:7005 1、安装redis上传服务器,解压,编译

    2022年4月16日
    37
  • SqlSessionTemplate是如何保证MyBatis中SqlSession的线程安全的?「建议收藏」

    SqlSessionTemplate是如何保证MyBatis中SqlSession的线程安全的?「建议收藏」一、DefaultSqlSession的线程不安全性在MyBatis架构中SqlSession是提供给外层调用的顶层接口,实现类有:DefaultSqlSession、SqlSessionManager以及mybatis-spring提供的实现SqlSessionTemplate。默认的实现类为DefaultSqlSession如。类图结构如下所示:对于MyBatis提供的原生实现类来…

    2022年5月31日
    35
  • 最新安卓JAVA模拟器_安卓java模拟器完美版下载-安卓java模拟器直装最新版下载v1.4.6 – 欧普软件园…

    最新安卓JAVA模拟器_安卓java模拟器完美版下载-安卓java模拟器直装最新版下载v1.4.6 – 欧普软件园…安卓java模拟器是一款十分好用的游戏模拟器,在这款软件里面你能够看到海量的游戏内容,各种2D、3D的游戏玩,无需你下载,直接在模拟器里面就可以开启你的游戏模式了。虚拟按键的设置也是十分简单的,快来下载享受游戏带来的快乐吧!安卓java模拟器软件介绍J2ME模拟器Android版J2MELoader是一个Android版的J2ME(Java2MicroEdition)模拟器。它支持大多数的…

    2022年7月7日
    33
  • Java IO流处理 面试题汇总

    Java IO流处理 面试题汇总说明:本节内容来源于网络汇总输入输出流是相对于内存而言的!1、面试题汇总(1)java中有几种类型的流?字符流和字节流。字节流继承inputStream和OutputStream,字符流继承自InputSteamReader和OutputStreamWriter。(2)谈谈JavaIO里面的常见类,字节流,字符流、接口、实现类、方法阻塞答:输入流就…

    2022年6月14日
    24
  • pgpstrom2021.5激活码[在线序列号]

    pgpstrom2021.5激活码[在线序列号],https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月18日
    151
  • 【centos7 + MySQL5.7 安装】centos7 安装MySQL5.7

    【centos7 + MySQL5.7 安装】centos7 安装MySQL5.7说明:我们安装MySQL位置在/usr/local下第一步、下载MySQL安装包:[root@localhostlocal]#wgethttps://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm安装mysql安装源:[root@localhostlocal]#yum-ylocali…

    2022年6月9日
    31

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号