⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displayfeaturedproducttype.aspx

📁 asp.net技术内幕的书配源码
💻 ASPX
字号:
<%@ Page Language="C#" %>
<%@ Register TagPrefix="SuperCompany" TagName="FeaturedProduct1"
  Src="FeaturedProduct1.ascx" %>
<%@ Register TagPrefix="SuperCompany" TagName="FeaturedProduct2"
  Src="FeaturedProduct2.ascx" %>

<Script runat="Server">

void Page_Load(object sender, EventArgs e) {
  string strFeatured;
  Random RanNum = new Random();
  Control ctlControl=null;

  switch(RanNum.Next(1,3)) {
	case 1:
		ctlControl = LoadControl("FeaturedProduct1.ascx");
		((FeaturedProduct1)ctlControl).BackColor = "Yellow";
		break;
	case 2:
		ctlControl = LoadControl("FeaturedProduct2.ascx");
		((FeaturedProduct2)ctlControl).BackColor = "Yellow";
		break;
  }
  if (ctlControl!=null)
	plhFeatured.Controls.Add(ctlControl);
}

</Script>  

<html>
<head><title>DisplayFeaturedProductType.aspx</title></head>
<body>

<asp:PlaceHolder
  id="plhFeatured"
  Runat="Server" />

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -