Hi steve,
I think you are using ASP.NET 2.0, yes? If so, due to the new compilation
model of ASP.NET 2.0 web application, all the page classes (or usercontrol
class) are dynamically compiled at runtime. And as for the page's class
type, both the runtime page type(derived from codebehind page class) and
the codebehind page class are compiled and defined at runtime. So at
design-time, we can not directly reference that partial class type (unless
we use @Reference directive to reference that certain page or usercontrol's
file ). For your scenario, I think you can consider the following options:
1. Define an additional base page type, and let the page's codebehind
class derived from that base page type. e.g:
public partial class XXXPage : MyBasePageClass
{
Then, at runtime, you can cast the page to that base page class to access
any particular properties.
2.or you can also consider using interface to encapsulate some common
functions and let the codebehind page class implement that interface. And
at runtime, we cast the page instance to the instance type to access
specific data.
public partial class XXXPage : System.Web.UI.Page, ICustomIntf
{
Here is other web articles describing the ASP.NET 2.0 compilation/page
model:
http://msdn.microsoft.com/msdnmag/is...ExtremeASPNET/ http://odetocode.com/Blogs/scott/arc...6/30/1889.aspx
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)