Make a public property or method on your control that accepts the value from
your page. Something like this:
Public Sub SetSection(Section as Integer)
'Now I have the value I need
End Sub
The from your page, call it like this to pass the value along:
MyControlName.SetSectionID(sectionID)
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"DC Gringo" <> wrote in message
news:...
> I have a simple index.aspx page that declares and sets a sectionID in the
> Page_Load. The in a user control later on in the page, I read the
sectionID
> variable (in the control's Page_Load) to determine which panel to show.
It
> does not work
>
> "Name 'sectionID' is not declared" is my error while compiling the user
> control.
>
> What am I doing wrong?
>
>
> This is in my main page's Page_Load
>
> Dim sectionID As String = "about"
> --
>
>
> This is in my user control's Page_Load
>
> If sectionID = "about" Then
> pnlAbout.Visible = True
> ElseIf sectionID = "home" Then
> pnlHome.Visible = True
> End If
>
>
> _____
> DC G
>
>