M
Mad Scientist Jr
I have a asp.net.vb page with a custom control, and for some reason
the codebehind is not seeing the control.
The control is in a file "page_footer.ascx" in the root of the site
and contains the following:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="page_footer.ascx.vb" Inherits="mysite1.page_footer"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<script language="VB" runat="server">
Public sFooterText As String = ""
</script>
<table border="0" width="100%" cellSpacing="0" cellPadding="0">
<tr>
<td align="right"><font
class="copy"><%=sFooterText%></font> </td>
</tr>
</table>
The control is defined in my ASPX page (also in the root of the site)
at the top of the HTML as:
<%@ Register TagPrefix="site1" TagName="page_footer"
Src="page_footer.ascx" %>
An instance is defined in the HTML body as:
<site1age_footer id="page_footer_1" runat="server"
sFooterText="Copyright 2004"></site1age_footer><br>
In the codebehind I try this:
page_footer_1.sFooterText = "Copyright 2003"
^^^^^^^^^^^^^
but "page_footer_1" is underlined in blue and I get the error 'Name
"page_footer_1" is not declared.'
What am I doing wrong?
the codebehind is not seeing the control.
The control is in a file "page_footer.ascx" in the root of the site
and contains the following:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="page_footer.ascx.vb" Inherits="mysite1.page_footer"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<script language="VB" runat="server">
Public sFooterText As String = ""
</script>
<table border="0" width="100%" cellSpacing="0" cellPadding="0">
<tr>
<td align="right"><font
class="copy"><%=sFooterText%></font> </td>
</tr>
</table>
The control is defined in my ASPX page (also in the root of the site)
at the top of the HTML as:
<%@ Register TagPrefix="site1" TagName="page_footer"
Src="page_footer.ascx" %>
An instance is defined in the HTML body as:
<site1age_footer id="page_footer_1" runat="server"
sFooterText="Copyright 2004"></site1age_footer><br>
In the codebehind I try this:
page_footer_1.sFooterText = "Copyright 2003"
^^^^^^^^^^^^^
but "page_footer_1" is underlined in blue and I get the error 'Name
"page_footer_1" is not declared.'
What am I doing wrong?