In your code-behind, do: protected withevents MyHeader as header, where MyHeader *must* match whatever you use for ID of the instance of the control on your page, and header is the name of the user control class
----- Guoqi Zheng wrote: ----
Dear sir
I have Page Header user control. On my main page, I have the following code
<uc1:header id="MyHeader" runat="server
PageName="OurProducts.aspx"></uc1:header
PageName property is a public variable inside that user control. When I pu
the value of PageName inside the html code, everything works ok. However,
would like to determine the value of PageName by coding. So I do th
following
public Sub Page_Load(ByVal sender As System.Object, ByVal e A
System.EventArgs) Handles MyBase.Loa
MyHeader.PageName = "Others.aspx
End Su
When I tried to compile the code, I always get an error of Name "MyHeader
not declared
Can someone point out what I did wrong here? I am using VS.NET 200
-
Met vriendelijke groet
Guoqi Zhen
Tel: +31 (0) 23 540742
Mob: 064825252
http://www.meetholland.co