cannot access class?

D

Daves

I have a custom (derived) Page class called BasePage where I define a class
called ImgLink and it has a public constructor:

public class ImgLink{ publicImgLink(params...)}

From the Masterpage I instantiate a BasePage class to access the ImgLink
class as:

BasePage _basePage = (BasePage) this.Page;


Still, I cannot access the _basePage.ImgLink class... why is that?
 
B

Bjorn Abelli

...
I have a custom (derived) Page class called BasePage where I
define a class called ImgLink and it has a public constructor:

public class ImgLink{ publicImgLink(params...)}

Do you define this *inside* your BasePage class?

Then it's an "inner class", not a method or field of the class, but a class
by itself...
From the Masterpage I instantiate a BasePage class to
access the ImgLink class as:

BasePage _basePage = (BasePage) this.Page;

Still, I cannot access the _basePage.ImgLink class...
why is that?

Because of what I wrote above, it's not accessible through an instance of
the class, but through the class itself:

BasePage.ImgLink x = new BasePage.ImgLink(...);

// Bjorn A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top