|
|
 |
BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2
 | This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages by Jacob J. Sanford; ISBN: 9780470124482 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

December 23rd, 2007, 12:26 AM
|
|
Authorized User
|
|
Join Date: Dec 2007
Location: Braselton, Georgia, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Help with Partial classes: C# -> VB.NET
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
|

December 23rd, 2007, 12:52 AM
|
|
Authorized User
|
|
Join Date: Dec 2007
Location: Braselton, Georgia, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Okay, I know it's bad form to reply to my own topic, but I figured out this issue.
Instead of a class, myValue is a property of the class MasterPage (which I should have realized), and chapter 9 of Beginning ASP.NET 2.0 deals with shared methods and properties.
From there, it was just a matter of using the text as a guide.
I apologize if anyone's used any time trying to figure out what I've done wrong!
Thanks again,
Jordan Burke
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |