Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Mad Scientist Jr #1
asp.net page not seeing custom control, can't set properties
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:
<site1:page_footer id="page_footer_1" runat="server"
sFooterText="Copyright 2004"></site1:page_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?
Mad Scientist Jr Guest
-
Making Custom Control Properties Visible in Visual Studio's Properties Palette
I am learning how to use the System.ComponentModel class in VB.NET so that I can add my ASP.NET controls to Visual Studio .NET 2003. I have managed... -
Accessing properties in custom control
Hi all, This is probably a newbie question, but... I have a custom control inherited from System.Web.UI.WebControls.Table. Here is the code: ... -
Accessing custom control properties
Hello, I've created a custom control and want to set properties in the aspx page. <%@ Page language="c#" Codebehind="test_control2.aspx.cs"... -
Custom Control - inherit child properties?
Hey All, I'm building a custom control that contains a System.Web.UI.WebControls.Calendar object and am wondering about how to make the calendar's... -
Getting custom properties on a user control
I created a user web control, and here is the line in my ASPX that consumes that control. <joe:RunningSummary CurrentStep=2 id=myRunningSummary...



Reply With Quote

