displayfeaturedproductcodebehind.aspx

来自「asp.net技术内幕的书配源码」· ASPX 代码 · 共 25 行

ASPX
25
字号
<Script runat="Server">

Sub Page_Load
  Dim strFeatured As String
  Dim RanNum As New Random
  Dim ctlControl As Control

  strFeatured = "Featured" & RanNum.Next( 1, 3 ) & ".ascx"
  ctlControl = LoadControl( strFeatured )
  Ctype( ctlControl, FeaturedProduct ).BackColor="Orange"
  plhFeatured.Controls.Add( ctlControl )
End Sub

</Script>  

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

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

</body>
</html>

⌨️ 快捷键说明

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