Can't get VS 2005 to recognize page class

  • Thread starter Thread starter Ben Amada
  • Start date Start date
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
 
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)
 
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

Back
Top