Groups | Blog | Home
all groups > asp.net webcontrols > november 2003 >

asp.net webcontrols : Using Code behind


Jim
11/6/2003 12:12:42 PM
that should work, but sometimes VS flakes out.

I would delete the webpage and start over. I know it is
MicroKarL
11/6/2003 2:50:04 PM
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
11/6/2003 5:24:52 PM
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


[quoted text, click to view]

AddThis Social Bookmark Button