Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted (edited)

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:

<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:

Edited by mutant
Posted

You have to have a public property COPYRIGHT in your user control (ascx). Than you can set it from web form level:

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

A man and a dog have an average of three legs.

Beaware of Statistics.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...