Can't get VS 2005 to recognize page class

B

Ben Amada

In VS 2003, from a dynamically loaded user control, I could set a property
of the parent webform with the following line of code:

CType(Me.Page, SamplePage).TestProperty = "test"

However, in VS 2005, "SamplePage" doesn't show up in intellisense when
typing the line above and VS complains:

" Type 'SamplePage' is not defined. "

Any ideas why VS 2005 doesn't recognize SamplePage?

Thanks,
Ben
 
B

Bruce Barker

in vs2003, all the code behind we built into 1 dll, so any code behind class
could reference any other codebehind public properties

in vs2005, the code behind are partial class build into the page dll, so
they cannot refernce each other. if you want this feature:

1) you build a base class in app_code dir giving it the public properties
you want to expose to other pages
2) have the aspx codebehind inherit from that class. now other pages can
reference this properties


-- bruce (sqlwork.com)
 
B

Ben Amada

Bruce said:
in vs2003, all the code behind we built into 1 dll, so any code behind
class could reference any other codebehind public properties

in vs2005, the code behind are partial class build into the page dll, so
they cannot refernce each other. if you want this feature:

1) you build a base class in app_code dir giving it the public properties
you want to expose to other pages
2) have the aspx codebehind inherit from that class. now other pages can
reference this properties


-- bruce (sqlwork.com)

Thanks Bruce -- got it working per your instructions!

Ben
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top