温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:漂亮的ComponentArtWebUI及Demo源码
当前文件:
ComponentArtWebUI/common/controls/demo_top.ascx.cs[2K,2009-6-12 11:37:11],打开代码结构图
ComponentArtWebUI/common/controls/demo_top.ascx.cs[2K,2009-6-12 11:37:11],打开代码结构图1namespace Demos.common.controls 2
{ 3
using System; 4
using System.Data; 5
using System.Drawing; 6
using System.Web; 7
using System.Web.UI.WebControls; 8
using System.Web.UI.HtmlControls; 9
10
/// <summary> 11
/// Summary description for demo_top. 12
/// </summary> 13
public class demo_top : System.Web.UI.UserControl { 14
protected string Root; 15
protected ComponentArt.Web.UI.SiteMap Breadcrumbs; 16
protected System.Web.UI.WebControls.Image ca_logo; 17
protected System.Web.UI.WebControls.Image home; 18
protected System.Web.UI.WebControls.Image website; 19
protected System.Web.UI.WebControls.Literal Css; 20
21
private void Page_Load(object sender, System.EventArgs e) { 22
Root = Request.ApplicationPath; 23
InitializeCss(); 24
InitializeBreadcrumbs(); 25
InitializeHeader(); 26
} 27
28
private void InitializeCss() { 29
Css.Text = @"<!--[if lt IE 7]><link rel=""stylesheet"" type=""text/css"" href=""" + Root + @"/common/css/ie6-demos.css"" /><![endif]-->"; 30
} 31
32
private void InitializeHeader() { 33
string ImagePath = Root + "/common/images/demos/"; 34
35
home.Attributes.Add("onmouseover","this.src='" + ImagePath + @"header-home-hover.png';"); 36
home.Attributes.Add("onmouseout","this.src='" + ImagePath + "header-home.png';"); 37
home.Attributes.Add("onclick","window.open('" + Root + "','_self');"); 38
home.Attributes.Add("title","Live Demos - Home"); 39
40
website.Attributes.Add("onmouseover","this.src='" + ImagePath + "header-website-hover.png';"); 41
website.Attributes.Add("onmouseout","this.src='" + ImagePath + "header-website.png';"); 42
website.Attributes.Add("onclick",@"window.open('http://www.componentart.com/','_blank');"); 43
website.Attributes.Add("title","ComponentArt.com"); 44
45
ca_logo.Attributes.Add("onmouseover","this.src='" + ImagePath + @"header-logo-hover.png';"); 46
ca_logo.Attributes.Add("onmouseout","this.src='" + ImagePath + "header-logo.png';"); 47
ca_logo.Attributes.Add("onclick","window.open('" + Root + "','_self');"); 48
ca_logo.Attributes.Add("title","Live Demos - Home"); 49
} 50
51
private void InitializeBreadcrumbs() { 52
string Separator = "<img src='" + Root + "/common/images/navigation/chevron-breadcrumb.png' width='5' height='6' alt='>' title='>' />"; 53
Breadcrumbs.BreadcrumbsSeparatorString = Separator; 54
55
if (Breadcrumbs.SelectedNode != null && Breadcrumbs.SelectedNode.Value == "Control") 56
{ 57
ComponentArt.Web.UI.SiteMapNode Node = Breadcrumbs.SelectedNode.Nodes[0].Nodes[0]; 58
Breadcrumbs.SelectedNode = Node; 59
} 60
} 61
62
Web Form Designer generated code 81
} 82
} 83






}