Bug in VS2005? ,or just not sure how to do this!

P

Paul

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.
 
D

David R. Longnecker

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
 
P

Paul

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.
--
Paul G
Software engineer.


Elmo Watson said:
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
 

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
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top