I have a file called clBasePage.cs in the appCode directory (using vs 2005)
and I have a master page in the root website directory called
Masterpage.master.cs.
In the masterpage file I have
public partial class QSISMasterPage : System.Web.UI.MasterPage
{
}
so it inherits System.Web.UI.MasterPage.
The problem is that in the file clBasePage.cs I can not access the
QSISMasterPage class as I tried
public class clsBasePage : System.Web.UI.Page
{
private QSISMasterPage master; // trying to declare a private variable of
type
}
QSISMasterPage but I get the error
type or namespace QSISMasterPage could not be found.
Any Suggestions? thanks.

Signature
Paul G
Software engineer.
David R. Longnecker - 19 Feb 2008 22:06 GMT
Paul-
What's the namespace of the QSISMasterPage? Sometimes, on web projects,
it's easy to get the namespaces confused if you move files in and out of
directories. I'd suggest double checking that and be sure it's what you
intended it to be (and that your addressing it correctly in your base page).
For example:
namespace SandBoxWeb
{
public partial class TestMasterPage: MasterPage
{ }
}
Would be addressed in a code behind as:
SandBoxWeb.TestMasterPage (or just TestMasterPage if within the same parent
scope).
Or...
namespace SandBoxWeb.test
{
public partial class ClientScriptBlock : MasterPage
{ }
}
Would be addressed in a code behind as:
SandBoxWeb.test.TestMasterPage (or just test.TestMasterPage if within the
same parent scope).
Hope this helps!
-dl
--
David R. Longnecker
http://blog.tiredstudent.com
> I have a file called clBasePage.cs in the appCode directory (using vs
> 2005)
[quoted text clipped - 17 lines]
> type or namespace QSISMasterPage could not be found.
> Any Suggestions? thanks.
Paul - 20 Feb 2008 00:54 GMT
thanks for the information, will double check the namespace tomorrow.

Signature
Paul G
Software engineer.
> Paul-
>
[quoted text clipped - 58 lines]
> > type or namespace QSISMasterPage could not be found.
> > Any Suggestions? thanks.
Elmo Watson - 19 Feb 2008 22:08 GMT
In my estimation, you should never directly access a page of any kind in a
class.
What exactly are you needing to do with the Master Page?
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
>I have a file called clBasePage.cs in the appCode directory (using vs 2005)
> and I have a master page in the root website directory called
[quoted text clipped - 17 lines]
>
> Any Suggestions? thanks.
Paul - 20 Feb 2008 00:57 GMT
I ended up creating a masterpage class in the app code directory. I
basically needed methods to be called each time a new page was loaded in (on
the master page which causes the master page to reload int). These methods
are used to change the menu depending on what page is loaded as well as
grabing a page id.
thanks.

Signature
Paul G
Software engineer.
> In my estimation, you should never directly access a page of any kind in a
> class.
[quoted text clipped - 27 lines]
> >
> > Any Suggestions? thanks.