Using Code behind

M

MicroKarL

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
 
J

Jim

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.
 
M

MicroKarL

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top