Atlas 学习之001:“ToggleButtonExtender”

 原文地址:http://blogs.vertigosoftware.com/alanl/archive/2006/07/27/3156.aspx

源码下载:http://blogs.vertigosoftware.com/files/alan/atlastogglebutton.zip

译文概要:

    使用“Atlas Control Toolkit”中的“ToggleButtonExtender”,你可以创建非常酷的“checkboxes”:“ ToggleButtonExtender”使用图片 来“装扮”ASP.NET 的“Checkbox”控件 !

 

详细步骤:

1、打开“Visual Studio 2005”,“新建网站”、在“我的模板”中选择“"Atlas" Web Site”、至于“位置”和“语言”,你可以随意选了,确定。

 

2、双击“Default.aspx”打开它,把下面的代码贴在“<form id="form1" runat="server">”的下面:

< atlas:ScriptManager ID = " ScriptManager1 "  runat = " server "   />
        
< div  class = " togglebutton " >
            
< asp:CheckBox ID = " CheckBox1 "  runat = " server "  Text = " Default ASP.NET Checkbox "   />< br  />< br  />
            
< asp:CheckBox ID = " CheckBox2 "  runat = " server "  Text = " Improved Checkbox with the ToggleButtonExtender "   />< br  />
            
< asp:CheckBox ID = " CheckBox3 "  runat = " server "  Checked = " true "  Text = " Can extend multiple checkboxes "   />< br  />
            
< asp:CheckBox ID = " CheckBox4 "  runat = " server "  Text = " Any icon can be used "   />
        
</ div >
        
< atlastoolkit:ToggleButtonExtender ID = " ToggleButtonExtender1 "  runat = " server " >
            
< atlastoolkit:ToggleButtonProperties TargetControlID = " CheckBox2 "  CheckedImageUrl = " images/checked.png "
                UncheckedImageUrl
= " images/unchecked.png "  ImageHeight = " 16 "  ImageWidth = " 16 "   />
            
< atlastoolkit:ToggleButtonProperties TargetControlID = " CheckBox3 "  CheckedImageUrl = " images/checked.png "
                UncheckedImageUrl
= " images/unchecked.png "  ImageHeight = " 16 "  ImageWidth = " 16 "   />
            
< atlastoolkit:ToggleButtonProperties TargetControlID = " CheckBox4 "  CheckedImageUrl = " images/ToggleButton_Checked.gif "
                UncheckedImageUrl
= " images/ToggleButton_Unchecked.gif "  ImageHeight = " 19 "  ImageWidth = " 19 "   />
        
</ atlastoolkit:ToggleButtonExtender >

 

3、选择“解决方案资源管理器”,新建“image”文件夹,然后把以下4个图片文件贴在“image”文件夹里,注意每个文件的名字不要搞错了!
:checked.png
:unchecked.png
:ToggleButton_Checked.gif
:ToggleButton_Unchecked.gif



4、选择“解决方案资源管理器”,右击“Bin”文件夹,把“AtlasControlToolkit.dll”、“Microsoft.AtlasControlExtender.dll”两个文件引用进来,这两个文件的位置大约如下:
“D:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/atlastogglebutton/70397d33/_shadow/70e01143/bin/1”,实在找不到,搜索一下!

 

5、保存网站所有文件,右击“ToggleButton.aspx”文件,选择“在浏览器中查看”,最后的效果应该出来了,比较酷哟!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值