Howdy folks,
I've been going through the book and following the examples, doing my best to convert the C# code in the
VB that I'm familiar with. (I'm also working in the Wrox Beginner's ASP.NET 2.0 book.)
At any rate, I'm getting a little stuck on the section where we pass values from the Master Page to the the Child page. This is the code I have in the code file for the Master Page (using VWD Express 2008):
----------------------------------------------------------------------
Partial Class MasterPage
Inherits System.Web.UI.MasterPage
Public Class myValue
Dim myValue("My Master Page String Value") As String
End Class
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = TextBox1.Text
TextBox1.Text = ""
End Sub
End Class
----------------------------------------------------------------------
I think that turns out okay, but I can't seem to figure out how to convert the C# code from page 239 into
VB, specifically the method:
----------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
MasterPage mp = (MasterPage)Page.Master
mpLabel.Text = mp.myValue
}
----------------------------------------------------------------------
I can figure out that we're supposed to create a new instance of our Master Page as the object "mp", but honestly, I'm not sure how to do that in
VB.
Any help that can be given would be great, even pointing me towards a reference that could explain it a little better.
Thanks in advance!
-Jordan Burke