i'm building a custom navbar control in VB. i'm using an array to organize all the data i need so that i can just loop through the array building the navbar as i go. when i try to compile the code i get the following error. any help would be GREATLY appreciated. <BR><BR>here's my code... <BR>Dim arrPages(10,3) As String <BR>arrPages(0,0) = "0" <BR>arrPages(0,1) = "main" <BR>arrPages(0,2) = "Main" <BR>arrPages(0,3) = "1" <BR><BR>arrPages(1,0) = "1" <BR>etc, etc... <BR><BR>when i compile i get this error... <BR>Declaration Expected <BR><BR>and it underlines the arrPages variable name.Are you possibly trying to assign those array member values inside the class but outside of any method in the class? If so, that's certainly illegal.<BR><BR>But why not do this the simpler way, in any case:<BR><BR>Dim arrPages As String(,) = { _<BR> { "0","main","Main","1" }, _<BR> { "1",..... }, _<BR> ...<BR> { "10", .... } _<BR> }<BR><BR>Declare and initialize all at once, at compile time. Much lower overhead at run time, anyway!<BR><BR>thanks for the response, bill. i'm kinda confused though. i did assign the member values outside of a method but i didn't know you couldn't do that since i also set default property values outside of any methods of the class. here's some more code...<BR><BR>=================================================<BR>Namespace Icb<BR><BR> Public Class Navbar<BR> Inherits WebControl<BR><BR> Private _selectedPage As String = "0"<BR> Private _UserRole As String = HttpContext.Current.Request.Cookies("UserRole").Value<BR> Private sRootPath As String = HttpContext.Current.Request.ApplicationPath<BR> Dim arrPages(10,3) As String.......<BR>================================================== ===<BR><BR>do i need to put these declarations in a constructor method? again, i'm kinda new to programming so be gentle.<BR><BR>thanks again for the response.<BR><BR>n1ckP<BR>You CAN *initialize* a member to a value.<BR><BR>Private _selectedPage As String = "0"<BR><BR>Or, as I did,<BR><BR>Dim arr As String(,) = { {"1","first"},{"2","second"} }<BR><BR>But the way you had originally coded it, you were *not* using an *initializer*. You were simply trying to execute assignment statements.<BR><BR>Inside of classes yet outside of methods, you are only allowed to use the = sign in the same line where you declare (Dim, Priviate, etc.) a member variable.<BR><BR>It's a subtle distinction. You might wish that a different syntax had been chosen for initializers. Maybe:<BR><BR>Private _selectedPage As String ::== "0"<BR>or<BR>Private _selectedPage As String Initialize With ( "0" )<BR><BR>But there are good historic reasons (in other languages, as well as VB) for using simply the = in that special way.<BR><BR><BR>Thanks, Bill! it's all starting to make sense now. everything works great and i really appreciate u taking the time to explain in detail.<BR><BR>n1ckP