473,405 Members | 2,141 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,405 software developers and data experts.

Element are reported to be "not declared"

The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance



Oct 12 '08 #1
5 2793
I've seen it happen before, although I'm not exactly sure why (I think
sometimes it can happen if you add the control using copy and paste, but
once again, I'm not sure). But it is usually because the controls are not
declared correctly in the *.aspx.designer.vb file. To get the
*.aspx.designer.vb file updated, here are some of the ways that sometimes
work (since the *.aspx.designer.vb file is intended to be automatically
generated rather than manually updated, I'm not going to promise anything):

1. Open the *.aspx file and switch between design and source views
2. Open the *.aspx.designer.vb file and update it manually (note that these
changes will be overridden the next time the *.aspx.designer.vb file is
generated)
3. Open the *.aspx file and remove and add the controls again; it is usually
more guaranteed to update the *.aspx.designer.vb file if you do this using
the ToolBox or IntelliSense
4. Close and reopen Visual Studio

All of these suggestions are simply things I sometimes try when I come
across the situation you mentioned, so they are purely from experience and I
have done no testing on when and whether they always work, so hopefully they
will work for you. (NOTE: I use Visual Studio 2005, but unless the bug is
100% fixed in 2008 it will probably apply mostly the same there). Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:ux*************@TK2MSFTNGP03.phx.gbl...
The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance



Oct 12 '08 #2
Because it's in a template, you can't reference it directly. Try using the
LoginView1's FindControl method to gain access to the control in the
template.

Hope this helps,
Mark Fitzpatrick

"AAaron123" <aa*******@roadrunner.comwrote in message
news:ux*************@TK2MSFTNGP03.phx.gbl...
The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance


Oct 12 '08 #3
I didn't know there was an *.aspx.designer.vb file.
They do not show in my solution explorer.
Now that I know that, I can find much info relating to it.
(In fact, others have discussed the very topic of this thread.)
However, no where do I learn how to display those files.
I played with the "show all files" and also searched for *.aspx.designer.vb
in help.
Got many hits but I guess everyone figures that how to display those files
in the solution explorer is obvious.

Can you tell me how to make those file names show?

Thanks
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:uX**************@TK2MSFTNGP03.phx.gbl...
I've seen it happen before, although I'm not exactly sure why (I think
sometimes it can happen if you add the control using copy and paste, but
once again, I'm not sure). But it is usually because the controls are not
declared correctly in the *.aspx.designer.vb file. To get the
*.aspx.designer.vb file updated, here are some of the ways that sometimes
work (since the *.aspx.designer.vb file is intended to be automatically
generated rather than manually updated, I'm not going to promise
anything):

1. Open the *.aspx file and switch between design and source views
2. Open the *.aspx.designer.vb file and update it manually (note that
these changes will be overridden the next time the *.aspx.designer.vb file
is generated)
3. Open the *.aspx file and remove and add the controls again; it is
usually more guaranteed to update the *.aspx.designer.vb file if you do
this using the ToolBox or IntelliSense
4. Close and reopen Visual Studio

All of these suggestions are simply things I sometimes try when I come
across the situation you mentioned, so they are purely from experience and
I have done no testing on when and whether they always work, so hopefully
they will work for you. (NOTE: I use Visual Studio 2005, but unless the
bug is 100% fixed in 2008 it will probably apply mostly the same there).
Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:ux*************@TK2MSFTNGP03.phx.gbl...
>The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance




Oct 13 '08 #4
There are several ways to view the *.aspx.designer.vb file. Here is a quick
list:

1. In the Solution Explorer, right-click the *.aspx file and select "View
Code Gen File"
2. In the Solution Explorer, select "Show All Files" (this is the second
icon from the left, but it sounds like you know about Show All Files). The
*.aspx.designer.vb file will be listed with it's associated *.aspx file, you
may need to click the +/- next to the *.aspx file to see it.

If both of the above fail, check the following:

1. Although it is not the default and is not recommended, I believe there is
a way to have the code that would normally be in the *.aspx.designer.vb file
automatically added to a REGION in the *.aspx.vb file like it was back in
ASP.NET 1.1, but I would assume you would have noticed it there if that were
the case.
2. View the directory of the project using Windows Explorer to see if the
file really does exist (I don't know why it wouldn't, but there is probably
a setting somewhere in Visual Studio that I can't find that allows you to
have the *.aspx.designer.vb file not automatically generated)

If all of these fail, I am not sure what to do. Hopefully now that you know
about the file you can manage to find something on the web or possibly
posting a new post with a more specific subject you will get some better
responses. Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I didn't know there was an *.aspx.designer.vb file.
They do not show in my solution explorer.
Now that I know that, I can find much info relating to it.
(In fact, others have discussed the very topic of this thread.)
However, no where do I learn how to display those files.
I played with the "show all files" and also searched for
*.aspx.designer.vb in help.
Got many hits but I guess everyone figures that how to display those files
in the solution explorer is obvious.

Can you tell me how to make those file names show?

Thanks
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:uX**************@TK2MSFTNGP03.phx.gbl...
>I've seen it happen before, although I'm not exactly sure why (I think
sometimes it can happen if you add the control using copy and paste, but
once again, I'm not sure). But it is usually because the controls are not
declared correctly in the *.aspx.designer.vb file. To get the
*.aspx.designer.vb file updated, here are some of the ways that sometimes
work (since the *.aspx.designer.vb file is intended to be automatically
generated rather than manually updated, I'm not going to promise
anything):

1. Open the *.aspx file and switch between design and source views
2. Open the *.aspx.designer.vb file and update it manually (note that
these changes will be overridden the next time the *.aspx.designer.vb
file is generated)
3. Open the *.aspx file and remove and add the controls again; it is
usually more guaranteed to update the *.aspx.designer.vb file if you do
this using the ToolBox or IntelliSense
4. Close and reopen Visual Studio

All of these suggestions are simply things I sometimes try when I come
across the situation you mentioned, so they are purely from experience
and I have done no testing on when and whether they always work, so
hopefully they will work for you. (NOTE: I use Visual Studio 2005, but
unless the bug is 100% fixed in 2008 it will probably apply mostly the
same there). Good Luck!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"AAaron123" <aa*******@roadrunner.comwrote in message
news:ux*************@TK2MSFTNGP03.phx.gbl...
>>The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance





Oct 13 '08 #5
Thanks, I want to finish looking at why I don't have *.aspx.designer.vb
files; then I'll try that.

Thanks again

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Because it's in a template, you can't reference it directly. Try using the
LoginView1's FindControl method to gain access to the control in the
template.

Hope this helps,
Mark Fitzpatrick

"AAaron123" <aa*******@roadrunner.comwrote in message
news:ux*************@TK2MSFTNGP03.phx.gbl...
>The aspx file includes the following:

<asp:LoginView ID="LoginView1" Runat="server">

<LoggedInTemplate>

<fieldset>

<asp:label id="message1" runat="server" />

The .vb file includes in a method

If (ChangePassword1.CurrentPassword.ToString() =
ChangePassword1.NewPassword.ToString) Then

Message1.Visible = True

Both Message1 and ChangePassword1 are reported to be "not declared"

The drop down list in the .vb file does not show them.
They were typed as shown, not draged from the toolbox.
The loginView1 does show in that drop down list.

Does any of this make sense to you?
Do you know what I have that is wrong?

Thanks in advance



Oct 13 '08 #6

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"...
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...
1
by: Derek | last post by:
I am writing a web application for job seekers, and am adding a section that allows administrators to upload jobs to the system via xml. I have used an xml schema to validate the xml they upload....
1
by: Bimal | last post by:
Hi, I upgraded my gcc from 2.95 to 3.3. When I compile some projects I get error messages saying... /usr/local/include/c++/3.3/ctime:68: error: `tm' not declared...
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...
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 :
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...
2
by: Monty | last post by:
Hello, 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...
3
by: zoeb | last post by:
Hi, I am declaring an array which carries x coordinates, however these will vary depending on the geometry the user enters. I have set my code up as follows, but get the "initializer element...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.