Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Name is not declared

Reply
Thread Tools

Name is not declared

 
 
DC Gringo
Guest
Posts: n/a
 
      02-27-2004
I'm getting a BC30451: Name 'pageID' is not declared.

I have a user control that contains a simple condition to display one row or
another like:

<% If x = 1 Then %>
....some html...
<% Else %>
....some html...
<% End If %>

The control is used to in two different .aspx pages (e.g. first.aspx and
second.aspx). In each .aspx page, I've tried to set this variable right
after Private Sub Page_Load in the code-behind page to no avail...such as:

Public Class WebForm1
Inherits System.Web.UI.Page
Web Form Designer Generated Code

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Dim x As Integer = 10000

End Class

--
_____
DC G


 
Reply With Quote
 
 
 
 
Vikas Ahuja
Guest
Posts: n/a
 
      03-02-2004
I dont see a "pageID" variable declared in your code, but variables that you
want to use in the HTML part must have Protected access at least.


"DC Gringo" <(E-Mail Removed)> wrote in message
news:uI9DquT$(E-Mail Removed)...
> I'm getting a BC30451: Name 'pageID' is not declared.
>
> I have a user control that contains a simple condition to display one row

or
> another like:
>
> <% If x = 1 Then %>
> ...some html...
> <% Else %>
> ...some html...
> <% End If %>
>
> The control is used to in two different .aspx pages (e.g. first.aspx and
> second.aspx). In each .aspx page, I've tried to set this variable right
> after Private Sub Page_Load in the code-behind page to no avail...such as:
>
> Public Class WebForm1
> Inherits System.Web.UI.Page
> Web Form Designer Generated Code
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> End Sub
>
> Dim x As Integer = 10000
>
> End Class
>
> --
> _____
> DC G
>
>



 
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
declared or not declared ? JohnZing ASP .Net 3 02-05-2006 08:38 PM
Name is not declared DC Gringo ASP .Net 1 02-27-2004 02:40 PM
Name <whatever> not declared?!?!?! Aaargh!! Scott M. ASP .Net 2 02-05-2004 06:18 PM
"name not declared" but it is TJS ASP .Net 2 02-03-2004 11:47 PM
Name 'DiffGram' is not declared. Guoqi Zheng ASP .Net 0 01-12-2004 04:42 PM



Advertisments