473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Control in Master Page.. "Name lblStatus is not declared"

Hello,

[ASP.Net, VS2005] I have a label control in my master page like this:
<asp:Label ID=lblStatusMessage runat="server"></asp:Label>

When I reference the control in my code-behind I get this error
"Name 'lblStatusMessage' is not declared"

If I add a declaration for it at the top of my partial class like so:
Protected lblStatusMessage As System.Web.UI.WebControls.Label

then I get this error:
'lblStatusMessage' is already declared as 'Protected Dim WithEvents
lblStatusMessage As System.Web.UI.WebControls.Label' in this class.
MasterPage.master.vb

This happens even I drag a control into the masterpage from the toolbox. Any
ideas?? Thanks!

Monty

Dec 28 '06 #1
2 3316
I am using Web Application Projects, and it appears that this master page
does not have a designer (I have "show all docs" turned on, and I can see
the vb class but not the designer). Not sure where it went, or how I could
create a new one?
Dec 28 '06 #2
Hi Monty,

Based on my understanding, you're having trouble to correctly add controls
to the master page and reference them in code-behind.

I just tried it on two different VS2005: one with the Web Application
Project add-on, one with VS2005 SP1 (which already integrated the Web
Application Project add-on); both work correctly for the master page and
show the .master.designer.vb correctly in solution explorer.

Does this issue only exists in one of your project or it exists in even a
simplest new project?

Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Dec 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DC Gringo | last post by:
I'm getting a "BC30451: Name 'CRListType' is not declared." error Here's the top of the page where I'm getting stuck... <%@ Control Language="vb" AutoEventWireup="false"...
3
by: Alfred E Neuman | last post by:
I've read that... AClass ac = AClass( "name", 23 ); is less efficient than... AClass ac( "name", 23 ); because the first has to create a temporary object which is then assigned to ac. ...
4
by: Dan Jacobson | last post by:
Using <A name="x_y-z"></A>, I even get nervous about the _ and -. w3-recs/RECS/html4/struct/links.html seems to say all of ascii is cool and beyond. Anyway, just what is the safe range for...
10
by: ST | last post by:
Hi, I'm new to vb.net programming, and I keep getting this error: Name 'GetQuery' is not declared. I can't figure out why?? It seems like I have the right references/namespaces. This is my code...
2
by: TJS | last post by:
it says the name is not declared, but it is how can I fix this ? Compiler Error Message: BC30451: Name 'arrReportsList' is not declared. ========================== if...
1
by: Aimee | last post by:
Help! The asp.net 1.1 application is running on a Windows 2003 server. One of our users is unable to use the application. The client machine is running Windows 95 and IE6 Version: 6.0. After the...
2
by: fabrice | last post by:
Hello I'm getting an error during a .vb file compilation. My command is : vbc /t:library /r:system.web.dll /r:system.dll /r:mscorlib.dll myFile.vb The error is :
5
by: Kevin R | last post by:
I'm trying to update a sql database. It's modified Oledb code from an example that did work with an access database. How can I tweak my code to make it work? Thanks in advance. Kevin...
3
by: JohnJohn | last post by:
Hello. I have an aspx page called MyAspx.aspx (for the sake of this discussion) and its associated code file, MyAspx.aspx.vb. In the .vb file, I have declared a variable as follows: Public...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.