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.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.
"Chris" <no@spam.com> wrote in message
news:eR**************@TK2MSFTNGP11.phx.gbl...
In C# I can do:
((Page)this.Parent).Title = "Title"
Why doesn't this work in VB:
DirectCast(me.Parent, Page).Title = "Title"
The Title var doesn't show up in VB.
Thanks.
Chris