Kevin said:
Use CType(me.Parent, Page).Title = "Title"
The diffeence is the CType will convert to any type that can be converted to
the type. DirectCast only casts the type if the type is exactly the same.
Since your Page class is not System.Web.UI.Page, but a derived class with a
different name, DirectCast will fail unless you cast it to the exact type of
your page class.
I'm sorry but I have to disagree with you.
This code converts the object to a Page object
((Page)this.Parent).Title
So does this code.
DirectCast(me.Parent, Page).Title
The problem isn't the casting to a page object, the code isn't failing
at design time cause of a miscast. The problem is that it says the page
object doesn't have a title property on it.
My real question is:
Page.Title exists in C# but not in VB? What am I not doing in VB to get
the page.title property.
Chris