客户端动态设置DropShadow控件时,$find()与BehaviorID属性的用途

     

     

       客户端使用DropShadow控件时,  在程序运行的过程中,无法在客户端使用getDocumentById方法,获取控件DropShadow,必须使用AJAX类库的方法“$find”,否则无法获取客户端的阴影控件。要使用方法“$find”,必须设置控件的BehaviorID属性,然后在客户端的访问中,使用“$find('DropShadowBehavior1')”来获取客户端的AJAX控件,代码如下:

 

<% @ Page Language="C#" AutoEventWireup="true" CodeFile="DropShadow_Client.aspx.cs" Inherits="DropShadow_Client" %>
<% @ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1"  %>
<% @ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp"  %>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html  xmlns ="http://www.w3.org/1999/xhtml"   >
< head  runat ="server" >
    
< title > 客户端动态设置DropShadow控件 </ title >
< script  language ="javascript"  type ="text/javascript" >
<!--
function Button1_onclick() {
var drop=$find("DropShadowBehavior1");
    drop.set_Width(
8); //阴影宽度
    drop.set_Rounded(true);    //显示锐化效果
     drop.set_Radius(8); //锐化幅度       
    drop.set_Opacity(0.7);        // 阴影透明度
}

// -->
</ script >
</ head >
< body >
    
< form  id ="form1"  runat ="server" >
    
< div >
        
< asp:ScriptManager  ID ="ScriptManager1"  runat ="server" >
        
</ asp:ScriptManager >
    
    
</ div >
        
< asp:Panel  ID ="Panel1"  runat ="server"  BackColor ="#E0E0E0"  Height ="101px"  Width ="288px" ></ asp:Panel >
        
< input  id ="Button1"  style ="width: 116px"  type ="button"  value ="应用配置"  language ="javascript"  onclick ="return Button1_onclick()"   />
        
< cc1:DropShadowExtender  ID ="DropShadowExtender1"  runat ="server"   TargetControlID ="Panel1"  BehaviorID ="DropShadowBehavior1" >
  
</ cc1:DropShadowExtender >
    
</ form >
</ body >
</ html >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值