emblewembl
Programmer
Hi, I am new to asp.net so forgive me if this is a dumb question! I have just created a user control which is very simple and is basically just a header which will go on each page of my site. The code is as follows:
In the page where I am using this control I set the text of SectionName in the Page_Load sub, as follows:
However, although this worked before I turned the header into a user control, it doesn't anymore, and I'm guessing I need to set the text value in a different way or place. Can you tell me how? The error I get is:
Compiler Error Message: BC30451: Name 'SectionName' is not declared.
Source Error:
Line 30:
Line 31: 'Set up text for section heading
Line 32: SectionName.Text = "NEW ORDER"
Line 33:
Line 34: DateToday.Text = today
Thanks! i love chocolate
Code:
<%@ Control Language="VB" %>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<img src="images/topImage1.gif" />
</td>
<td>
<asp:label class="SectionText" id="SectionName" runat="server"></asp:label>
</td>
</tr>
<tr>
<td colspan="2">
<img src="images/topImage2.gif" />
</td>
</tr>
</tbody>
</table>
Code:
'Set up text for section heading
SectionName.Text = "NEW ORDER"
Compiler Error Message: BC30451: Name 'SectionName' is not declared.
Source Error:
Line 30:
Line 31: 'Set up text for section heading
Line 32: SectionName.Text = "NEW ORDER"
Line 33:
Line 34: DateToday.Text = today
Thanks! i love chocolate