Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Name is not declared (http://www.velocityreviews.com/forums/t756530-name-is-not-declared.html)

DC Gringo 02-27-2004 02:11 PM

Name is not declared
 
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



Vikas Ahuja 03-02-2004 12:16 AM

Re: Name is not declared
 
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" <dcgringo@visiontechnology.net> wrote in message
news:uI9DquT$DHA.2480@TK2MSFTNGP12.phx.gbl...
> 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
>
>





All times are GMT. The time now is 11:53 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.