D
DC Gringo
I have an myPage.aspx with a myPage.ascx user control. The user control is
the main header of the page. I have some conditional case code in the user
control that I use which depends on a public variable "sectionID" set int he
myPage.aspx's code-behind. How can I reference that variable in my control
dynamically? I can hard card in the name of the myPage.aspx.vb class but
that doesn't help me if the control is used within many different pages.
---------------------------------------------------
In my myPage.aspx.vb, I have:
Public sectionID As String = "home"
---------------------------------------------------
In my myPage.ascx, I have:
Public Sub theSectionID()
Select Case <WHAT GOES HERE???>.sectionID
Case "home"
sectionHeaderLabel.Text = "Welcome section"
Case "about"
sectionHeaderLabel.Text = "Another section"
Case Else
sectionHeaderLabel.Text = "Error"
End Select
End Sub
the main header of the page. I have some conditional case code in the user
control that I use which depends on a public variable "sectionID" set int he
myPage.aspx's code-behind. How can I reference that variable in my control
dynamically? I can hard card in the name of the myPage.aspx.vb class but
that doesn't help me if the control is used within many different pages.
---------------------------------------------------
In my myPage.aspx.vb, I have:
Public sectionID As String = "home"
---------------------------------------------------
In my myPage.ascx, I have:
Public Sub theSectionID()
Select Case <WHAT GOES HERE???>.sectionID
Case "home"
sectionHeaderLabel.Text = "Welcome section"
Case "about"
sectionHeaderLabel.Text = "Another section"
Case Else
sectionHeaderLabel.Text = "Error"
End Select
End Sub