"Not Declared error" when I copy VB Code from one page to another

Last post 06-11-2007 2:10 PM by mjohnen. 2 replies.

Sort Posts:

  • "Not Declared error" when I copy VB Code from one page to another

    06-09-2007, 9:29 AM
    • Loading...
    • mjohnen
    • Joined on 05-15-2007, 12:34 PM
    • Posts 8

    Hi there...

    I'd appreciate if anybody helps me. Thank you all in advance.

    In a Visual Web Developer project, I've defined Page00.aspx, and beside it I've a VB code file named Page00.aspx.vb.  

    Trying to create Page99.aspx, I've copy-pasted all the controls from Page00 to Page 99, and same for VB Code, from Page00.aspx.vb to Page99.aspx.vb.

    When I tried the new page, the code in Page99.aspx.vb didn´t recognize the controls in Page99.aspx. For example, there appeared a message "TextBox1 not declared". I've revised all the ID's of the controls in Page99.aspx, but all the names are correct.

    Somehow the references to controls in page99.aspx are lost in vb code copy-paste event.

    Please, give me some advice on how can I establish this references again.

    Thanks a lot!

    Max  

  • Re: "Not Declared error" when I copy VB Code from one page to another

    06-11-2007, 2:01 AM
    Answer
    • Loading...
    • addie
    • Joined on 03-02-2007, 11:12 AM
    • Posts 291

    One thing that I can suggest is - delete Page99.aspx (remove it from your project). In the Solution explorer Copy Page00.aspx (Right Click and Cpoy) then similarly paste the copied page in the solution explorer. Now rename the copied page (in the Solution Explorer) to what you want (Page99.aspx). See if that helps.

  • Re: "Not Declared error" when I copy VB Code from one page to another

    06-11-2007, 2:10 PM
    • Loading...
    • mjohnen
    • Joined on 05-15-2007, 12:34 PM
    • Posts 8

    Thank you addie...

    I'll try this option.

    Max

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter