Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Using Code behind

Reply
Thread Tools

Using Code behind

 
 
MicroKarL
Guest
Posts: n/a
 
      11-06-2003
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


 
Reply With Quote
 
 
 
 
Jim
Guest
Posts: n/a
 
      11-06-2003
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.
 
Reply With Quote
 
 
 
 
MicroKarL
Guest
Posts: n/a
 
      11-06-2003
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" <(E-Mail Removed)> wrote in message
news:043c01c3a4a2$55c99f80$(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Non-code behind to code behind John ASP .Net 2 02-19-2007 07:08 PM
what is the difference between code inside a <script> tag and code in the code-behind file? keithb ASP .Net 1 03-29-2006 01:00 AM
Code-Behind Pain in the Behind! Daniel Manes ASP .Net 11 06-10-2005 09:47 PM
Fire Code behind code AND Javascript code associated to a Button Click Event =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?= ASP .Net 4 02-11-2004 07:31 AM
Re: Code Behind vs. no code behind: error Ben Miller [msft] ASP .Net 1 06-28-2003 01:46 AM



Advertisments