<%...@RegisterAssembly="System.Web.Extensio" />

日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

ajax擴展控件(2)

系統 2069 0
AlwaysVisibleControl控件,控件用于 將有該控件指定的面板或者空間,在頁面指定的方式顯示出來。

頁面代碼如下:

<% ... @PageLanguage = " C# " AutoEventWireup = " true " CodeFile = " AlwaysVisibleControlDemo.aspx.cs "
Inherits
= " AlwaysVisibleControlDemo "
%>

<% ... @RegisterAssembly = " System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35
"
Namespace
= " System.Web.UI " TagPrefix = " asp "
%>

<% ... @RegisterAssembly = " AjaxControlToolkit " Namespace = " AjaxControlToolkit " TagPrefix = " cc1 " %>

<! DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>

< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > 無標題頁 </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
&nbsp; < asp:ScriptManager ID ="ScriptManager1" runat ="server" >
</ asp:ScriptManager >
< asp:UpdatePanel ID ="update" runat ="server" >
< ContentTemplate >
< div style ="width:230px;height:100px" >
< asp:Panel ID ="displayPanel" runat ="server"
Width
="220px" BackColor ="White" ForeColor ="DarkBlue"
BorderWidth
="2" BorderStyle ="solid" BorderColor ="DarkBlue" style ="z-index:1;" >
< div style ="width:100%;height:100%;vertical-align:middle;text-align:center;" >< p > 可移動Panel: </ p ></ div >
</ asp:Panel >
< cc1:AlwaysVisibleControlExtender ID ="avce" runat ="server"
TargetControlID
="displayPanel"
VerticalSide
="Top" VerticalOffset ="10"
HorizontalSide
="Right" HorizontalOffset ="10"
ScrollEffectDuration
=".1" />
</ div >
< p >
選擇需要移動到的Panel位置.
</ p >
< p >

Position:
< asp:DropDownList ID ="ddlPosition" runat ="server"
AutoPostBack
="true" OnSelectedIndexChanged ="OnChange" >
< asp:ListItem Text ="默認" Selected ="true" Value ="None" />
< asp:ListItem Text ="左上" Value ="TL" />
< asp:ListItem Text ="上中" Value ="TC" />
< asp:ListItem Text ="右上" Value ="TR" />
< asp:ListItem Text ="左中" Value ="ML" />
< asp:ListItem Text ="中中" Value ="MC" />
< asp:ListItem Text ="右中" Value ="MR" />
< asp:ListItem Text ="左下" Value ="BL" />
< asp:ListItem Text ="中下" Value ="BC" />
< asp:ListItem Text ="右下" Value ="BR" />
</ asp:DropDownList >
</ p >

</ ContentTemplate >
</ asp:UpdatePanel >
&nbsp;
</ div >
</ form >
</ body >
</ html >



程序代碼如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using AjaxControlToolkit;

public partial class AlwaysVisibleControlDemo:System.Web.UI.Page
... {
protected void Page_Load( object sender,EventArgse)
... {
if ( ! IsPostBack)
avce.Enabled
= false ;
}

protected void OnChange( object sender,EventArgse)
... {
if ( string .IsNullOrEmpty(ddlPosition.SelectedValue) || ddlPosition.SelectedValue.Length != 2 )
... {
avce.Enabled
= false ;
return ;
}


avce.Enabled
= true ;
switch (ddlPosition.SelectedValue[ 0 ])
... {
case ' T ' :
avce.VerticalSide
= VerticalSide.Top;
break ;
case ' M ' :
avce.VerticalSide
= VerticalSide.Middle;
break ;
case ' B ' :
avce.VerticalSide
= VerticalSide.Bottom;
break ;
default :
avce.Enabled
= false ;
return ;
}


switch (ddlPosition.SelectedValue[ 1 ])
... {
case ' L ' :
avce.HorizontalSide
= HorizontalSide.Left;
break ;
case ' C ' :
avce.HorizontalSide
= HorizontalSide.Center;
break ;
case ' R ' :
avce.HorizontalSide
= HorizontalSide.Right;
break ;
default :
avce.Enabled
= false ;
return ;
}

}

}


ajax擴展控件(2)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 莱州市| 漳平市| 九龙坡区| 桃园市| 桐梓县| 和顺县| 宁陵县| 稻城县| 扶绥县| 汶上县| 页游| 柯坪县| 灵川县| 溧水县| 科技| 宜昌市| 景宁| 亳州市| 平山县| 旅游| 于田县| 绥棱县| 临邑县| 吐鲁番市| 磐石市| 钟祥市| 福安市| 太原市| 安徽省| 鱼台县| 垦利县| 湘潭县| 慈利县| 双城市| 扎兰屯市| 南开区| 德江县| 霍山县| 雷山县| 临清市| 威远县|