Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Referencing a property on the Site.Master?

Posted on 2011-03-16
5
Medium Priority
?
436 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 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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 75

Assisted Solution

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

*cast
0
 

Author Closing Comment

by:newbieweb
ID: 35152002
Thanks!
0
 
LVL 75

Expert Comment

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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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