惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
WordPress大学
WordPress大学
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
IT之家
IT之家
D
Docker
M
MIT News - Artificial intelligence
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
博客园_首页
Y
Y Combinator Blog
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
月光博客
月光博客
C
CXSECURITY Database RSS Feed - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
Vercel News
Vercel News
T
Threat Research - Cisco Blogs
T
Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 热门话题
T
The Exploit Database - CXSecurity.com
N
Netflix TechBlog - Medium
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
爱范儿
爱范儿
Cisco Talos Blog
Cisco Talos Blog
博客园 - 叶小钗
Latest news
Latest news
C
Check Point Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
P
Privacy International News Feed
MyScale Blog
MyScale Blog
Project Zero
Project Zero
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - 飞鼠

面试时英语自我介绍范文 判斷一天是否是年月中正確的日 - 飞鼠 - 博客园 Javascript中parseInt的一個問題 NUMERIC(3,1) 的含義 在 google 里找书下载的捷径 - 飞鼠 使用asp.net发送邮件详解 SQL密码 不斷提醒 datagrid用xml作为数据源,并且有更新,删除和排序的操作(VB) - 飞鼠 - 博客园 将xml作为DataGrid 操作(Sort, Edit, Delete) - 飞鼠 用ASP.NET结合XML制作广告管理程序 用ASP.NET结合XML制作广告管理程序(2) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(下)(转载) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(上)(转载) 分别用DataGrid、Repeater、DataList绑定XML数据的例子 - 飞鼠 - 博客园 将某一目录下的所有相同格式的 XML文件绑定到不同的DataGrid - 飞鼠 - 博客园 创建可编辑的xml文档(之五)执行中的treeview 控件 创建可编辑的xml文档(之四) 删除、改名、插入操作 创建可编辑的xml文档(之三)执行拖放操作
創建用戶控件 - 飞鼠 - 博客园
飞鼠 · 2006-01-12 · via 博客园 - 飞鼠

用戶控件

<% @ Control ClassName="Hello" %>
<script language="vb" runat="server">
Private _name As String
Public Property Name As String
Get
    Return _name
End Get
Set
    _name
=Value
End Set
End Property
Public Sub SayHello()
Label1.Text
="Hello," & _name & "!"
End Sub
</Script>
<asp:Label id=Label1 runat="server"></asp:Label>

Web頁面

<% @ Page Language="vb" %>
'以聲明方式添加用戶控件
<% @ Register TagPrefix="aspnetsbs" TagName="Hello" Src="Hello.ascx" %>
<html>
<head>
<script runat="server">
Sub Page_Load(Sender As Object,E As EventArgs)
MyHello.Name
="HURENFEI"
MyHello.SayHello
End Sub
</script>
</head>
<body>
<aspnetsbs:Hello id="MyHello" runat="server"/>
</body>
</html>

<% @ Page Language="vb" %>
'以編程方式添加用戶控件
<% @ Reference Control="Hello.ascx" %>
<html>
<head>
<script runat="server">
Sub Page_Load(Sender As Object,E As EventArgs)
Dim MyHello As Control
=LoadControl("Hello.ascx")
HelloHolder.Controls.Add(MyHello)
CType(MyHello,Hello).Name 
="HuRenfei"
CType(MyHello,Hello).SayHello
End Sub
</script>
</head>
<body>
<asp:placeholder id="HelloHolder" runat="server"/>
</body>
</html>


<% @ Control ClassName="Hello" %>