page and letting the control know of variables

mutant

Well-known member
Joined
Jan 19, 2003
Messages
1,771
Location
Enfield, CT, USA
User Rank
*Expert*
I recently started a ASP.NET project. I have a ascx file which I put on my web form. This is a part of my ascx file:
Code:
<div align="center"><%#COPYRIGHT%></div>
Then I drag the ascx onto my form.
How can I let the ascx control know of variable copyright from the page? I never worked with ascx files before :rolleyes:
 
Last edited by a moderator:
You have to have a public property COPYRIGHT in your user control (ascx). Than you can set it from web form level:
Code:
Protected WithEvents WebUserControl11 As WebUserControl1

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebUserControl11.COPYRIGHT = "My Copyright"
    End Sub
 
Back
Top