Solved

Referencing a property on the Site.Master?

Posted on 2011-03-16
5
428 Views
Last Modified: 2012-05-11
I have added this line to my .aspx page:

MasterPageFile="~/Site.master"

Here is the start of the Site.Master.cs file:

    public partial class Site : System.Web.UI.MasterPage
    {
        public RDDBAdminDataStore RDDB { get; set; }

I get these squiggly lines in the Site.Master with the following error:
The name 'RDDB' does not exist in the current context.

When I compile, they go away, then shortly return.

Any idea what's wrong??

newbieweb
0
Comment
Question by:newbieweb
  • 3
  • 2
5 Comments
 

Author Comment

by:newbieweb
ID: 35151685
Header:

<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="TableList.aspx.cs" Inherits="RDDBWebAdmin.TableList" %>
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 35151718
You either need to case "this.Master" to Site, as in:

RDDBAdminDataStore myVar = ((Site)this.Master).RDDB

Open in new window


or you can include the following directive in your content page:

<%@ MasterType TypeName="Nampespace.Site" %>

Open in new window



Then in code, you won't have to do the cast:

RDDBAdminDataStore myVar = this.Master.RDDB

Open in new window

0
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 500 total points
ID: 35151721
>>  You either need to case...

*cast
0
 

Author Closing Comment

by:newbieweb
ID: 35152002
Thanks!
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 35152050
NP. Glad to help  :  )
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now