Secret Control for ghost Creation

Source: Internet
Author: User

Use the volume control

<% @ 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 Interface

<% @ Page Language = "vb" %>
'Add the consumer control in the Xiaoming mode.
<% @ 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" %>
'Add the upload control as a stopped'
<% @ 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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.