Using Code behind

Discussion in 'ASP .Net Web Controls' started by MicroKarL, Nov 6, 2003.

  1. MicroKarL

    MicroKarL Guest

    Everyone..
    I have a really simple program using code behind. but I just keep
    getting the error saying my Label is not decleared...

    test.aspx:
    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb"
    Inherits="WebTest.WebForm3"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>WebForm3</title>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <asp:Label ID="Message" Runat="server" />
    </body>
    </HTML>

    test.aspx.vb:
    Imports System
    Imports System.Web.UI
    Imports System.Web.UI.WebControls

    Public Class WebForm3
    Inherits System.Web.UI.Page
    Protected WithEvents Message As System.Web.UI.WebControls.Label

    #Region " Web Form Designer Generated Code "
    .....
    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs)
    Message.Text = "Hello, World.."
    End Sub

    End Class


    The error message is "Message" is not decleared.. but Message is in the aspx
    page as a Label, I really don't understand why it says "Message" is not
    decleared.. Can someone tell me...

    Carl
    MicroKarL, Nov 6, 2003
    #1
    1. Advertising

  2. MicroKarL

    Jim Guest

    that should work, but sometimes VS flakes out.

    I would delete the webpage and start over. I know it is
    just a simple page, but that may work.
    Jim, Nov 6, 2003
    #2
    1. Advertising

  3. MicroKarL

    MicroKarL Guest

    It finally works after I left my desk for like half hour.... Is there anyway
    to make the VS.net more stable.. I mean... this is really annoying to keep
    getting bugs like these (there's another one... parse error.... then I
    restarted my computer and it works....) I suppose .net is easier to use than
    classic ASP, but to me.. classic is still the best tool because it's more
    stable....

    Carl


    "Jim" <> wrote in message
    news:043c01c3a4a2$55c99f80$...
    > that should work, but sometimes VS flakes out.
    >
    > I would delete the webpage and start over. I know it is
    > just a simple page, but that may work.
    MicroKarL, Nov 6, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    580
    Alphonse Giambrone
    Jun 28, 2003
  2. =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=

    Fire Code behind code AND Javascript code associated to a Button Click Event

    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    21,217
    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=
    Feb 11, 2004
  3. Daniel Manes

    Code-Behind Pain in the Behind!

    Daniel Manes, Jun 10, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    657
  4. keithb
    Replies:
    1
    Views:
    906
    Bruce Barker
    Mar 29, 2006
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    482
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page