Element are reported to be "not declared"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AAaron123

    Element are reported to be "not declared"

    The aspx file includes the following:

    <asp:LoginVie w ID="LoginView1 " Runat="server">

    <LoggedInTempla te>

    <fieldset>

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



    The .vb file includes in a method

    If (ChangePassword 1.CurrentPasswo rd.ToString() =
    ChangePassword1 .NewPassword.To String) Then

    Message1.Visibl e = 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







  • Nathan Sokalski

    #2
    Re: Element are reported to be &quot;not declared&quot;

    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
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


    "AAaron123" <aaaron123@road runner.comwrote in message
    news:uxKoZKBLJH A.728@TK2MSFTNG P03.phx.gbl...
    The aspx file includes the following:
    >
    <asp:LoginVie w ID="LoginView1 " Runat="server">
    >
    <LoggedInTempla te>
    >
    <fieldset>
    >
    <asp:label id="message1" runat="server" />
    >
    >
    >
    The .vb file includes in a method
    >
    If (ChangePassword 1.CurrentPasswo rd.ToString() =
    ChangePassword1 .NewPassword.To String) Then
    >
    Message1.Visibl e = 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
    >
    >
    >
    >
    >
    >
    >

    Comment

    • Mark Fitzpatrick

      #3
      Re: Element are reported to be &quot;not declared&quot;

      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" <aaaron123@road runner.comwrote in message
      news:uxKoZKBLJH A.728@TK2MSFTNG P03.phx.gbl...
      The aspx file includes the following:
      >
      <asp:LoginVie w ID="LoginView1 " Runat="server">
      >
      <LoggedInTempla te>
      >
      <fieldset>
      >
      <asp:label id="message1" runat="server" />
      >
      >
      >
      The .vb file includes in a method
      >
      If (ChangePassword 1.CurrentPasswo rd.ToString() =
      ChangePassword1 .NewPassword.To String) Then
      >
      Message1.Visibl e = 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
      >
      >
      >
      >
      >
      >
      >

      Comment

      • AAaron123

        #4
        Re: Element are reported to be &quot;not declared&quot;

        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" <njsokalski@hot mail.comwrote in message
        news:uXXZCpBLJH A.1556@TK2MSFTN GP03.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
        njsokalski@hotm ail.com
        有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

        >
        "AAaron123" <aaaron123@road runner.comwrote in message
        news:uxKoZKBLJH A.728@TK2MSFTNG P03.phx.gbl...
        >The aspx file includes the following:
        >>
        ><asp:LoginVi ew ID="LoginView1 " Runat="server">
        >>
        ><LoggedInTempl ate>
        >>
        ><fieldset>
        >>
        ><asp:label id="message1" runat="server" />
        >>
        >>
        >>
        >The .vb file includes in a method
        >>
        >If (ChangePassword 1.CurrentPasswo rd.ToString() =
        >ChangePassword 1.NewPassword.T oString) Then
        >>
        >Message1.Visib le = 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
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >
        >

        Comment

        • Nathan Sokalski

          #5
          Re: Element are reported to be &quot;not declared&quot;

          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
          njsokalski@hotm ail.com
          有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


          "AAaron123" <aaaron123@road runner.comwrote in message
          news:%23iFGQ1NL JHA.5648@TK2MSF TNGP05.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" <njsokalski@hot mail.comwrote in message
          news:uXXZCpBLJH A.1556@TK2MSFTN GP03.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.designe r.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
          >njsokalski@hotm ail.com
          >http://www.nathansokalski.com/
          >>
          >"AAaron123" <aaaron123@road runner.comwrote in message
          >news:uxKoZKBLJ HA.728@TK2MSFTN GP03.phx.gbl...
          >>The aspx file includes the following:
          >>>
          >><asp:LoginVie w ID="LoginView1 " Runat="server">
          >>>
          >><LoggedInTemp late>
          >>>
          >><fieldset>
          >>>
          >><asp:label id="message1" runat="server" />
          >>>
          >>>
          >>>
          >>The .vb file includes in a method
          >>>
          >>If (ChangePassword 1.CurrentPasswo rd.ToString() =
          >>ChangePasswor d1.NewPassword. ToString) Then
          >>>
          >>Message1.Visi ble = 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
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          • AAaron123

            #6
            Re: Element are reported to be &quot;not declared&quot;

            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" <markfitz@fitzm e.comwrote in message
            news:%23xTicXKL JHA.2164@TK2MSF TNGP02.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" <aaaron123@road runner.comwrote in message
            news:uxKoZKBLJH A.728@TK2MSFTNG P03.phx.gbl...
            >The aspx file includes the following:
            >>
            ><asp:LoginVi ew ID="LoginView1 " Runat="server">
            >>
            ><LoggedInTempl ate>
            >>
            ><fieldset>
            >>
            ><asp:label id="message1" runat="server" />
            >>
            >>
            >>
            >The .vb file includes in a method
            >>
            >If (ChangePassword 1.CurrentPasswo rd.ToString() =
            >ChangePassword 1.NewPassword.T oString) Then
            >>
            >Message1.Visib le = 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
            >>
            >>
            >>
            >>
            >>
            >>
            >>

            Comment

            Working...