Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 19 Feb 2008 21:01 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.